aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/eval.c2
-rw-r--r--test/src/eval-tests.el4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index a6e1d86c4ab..90d8c335185 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -737,6 +737,8 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
737 sym = XCAR (args); 737 sym = XCAR (args);
738 tail = XCDR (args); 738 tail = XCDR (args);
739 739
740 CHECK_SYMBOL (sym);
741
740 if (!NILP (tail)) 742 if (!NILP (tail))
741 { 743 {
742 if (!NILP (XCDR (tail)) && !NILP (XCDR (XCDR (tail)))) 744 if (!NILP (XCDR (tail)) && !NILP (XCDR (XCDR (tail))))
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el
index 59da6b7cc30..319dd91c86a 100644
--- a/test/src/eval-tests.el
+++ b/test/src/eval-tests.el
@@ -113,4 +113,8 @@ crash/abort/malloc assert failure on the next test."
113 (signal-hook-function #'ignore)) 113 (signal-hook-function #'ignore))
114 (should-error (eval-tests--exceed-specbind-limit)))) 114 (should-error (eval-tests--exceed-specbind-limit))))
115 115
116(ert-deftest defvar/bug31072 ()
117 "Check that Bug#31072 is fixed."
118 (should-error (eval '(defvar 1) t) :type 'wrong-type-argument))
119
116;;; eval-tests.el ends here 120;;; eval-tests.el ends here