aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Eggert2018-06-16 07:44:58 -0700
committerPaul Eggert2018-06-16 09:44:05 -0700
commite1284341fdc9a5d9b25339c3d47b02bc35cd8db4 (patch)
treef15a3b9382d6cf1c54a61eff801254a0ba3e2b0c /test
parent4753d79331f747001ebdbbe9c32b33597daab37f (diff)
downloademacs-e1284341fdc9a5d9b25339c3d47b02bc35cd8db4.tar.gz
emacs-e1284341fdc9a5d9b25339c3d47b02bc35cd8db4.zip
Fix byte compilation of (eq foo 'default)
Backport from master. Do not use the symbol ‘default’ as a special marker. Instead, use a value that cannot appear in the program, improving on a patch proposed by Robert Cochran (Bug#31718#14). * lisp/emacs-lisp/bytecomp.el (byte-compile--default-val): New constant. (byte-compile-cond-jump-table-info) (byte-compile-cond-jump-table): Use it instead of 'default. * test/lisp/emacs-lisp/bytecomp-tests.el: (byte-opt-testsuite-arith-data): Add a test for the bug.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 13df5912eef..f93c3bdc40f 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -286,7 +286,14 @@
286 (t))) 286 (t)))
287 (let ((a)) 287 (let ((a))
288 (cond ((eq a 'foo) 'incorrect) 288 (cond ((eq a 'foo) 'incorrect)
289 ('correct)))) 289 ('correct)))
290 ;; Bug#31734
291 (let ((variable 0))
292 (cond
293 ((eq variable 'default)
294 (message "equal"))
295 (t
296 (message "not equal")))))
290 "List of expression for test. 297 "List of expression for test.
291Each element will be executed by interpreter and with 298Each element will be executed by interpreter and with
292bytecompiled code, and their results compared.") 299bytecompiled code, and their results compared.")