aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPhilipp Stephani2018-04-15 23:45:27 -0700
committerPaul Eggert2018-04-15 23:50:06 -0700
commit9f2d21ca536ea7ca1da98e7bd57ae535ab394997 (patch)
treecc40bd68be4070f926852a8129f3d84ccb6bd86c /test
parent836dce63c3274eaa84a26c09a5b6dcb1522dba98 (diff)
downloademacs-9f2d21ca536ea7ca1da98e7bd57ae535ab394997.tar.gz
emacs-9f2d21ca536ea7ca1da98e7bd57ae535ab394997.zip
Avoid undefined behavior in 'defvar' (Bug#31072)
* src/eval.c (Fdefvar): Check that first argument is a symbol. * test/src/eval-tests.el (defvar/bug31072): New unit test.
Diffstat (limited to 'test')
-rw-r--r--test/src/eval-tests.el4
1 files changed, 4 insertions, 0 deletions
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