aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Eggert2018-06-16 07:44:58 -0700
committerPaul Eggert2018-06-16 07:48:51 -0700
commit9af399fd803ac1ca79f319945b9745b5b96122e7 (patch)
tree64d52ed4243fb0622771c2cbcef64c01c5d420d7 /test
parent34e257f83a22093cc8dd7a6cd8a4707123f5af77 (diff)
downloademacs-9af399fd803ac1ca79f319945b9745b5b96122e7.tar.gz
emacs-9af399fd803ac1ca79f319945b9745b5b96122e7.zip
Fix byte compilation of (eq foo 'default)
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 7c5aa9abedd..ba625490960 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -289,7 +289,14 @@
289 (t))) 289 (t)))
290 (let ((a)) 290 (let ((a))
291 (cond ((eq a 'foo) 'incorrect) 291 (cond ((eq a 'foo) 'incorrect)
292 ('correct)))) 292 ('correct)))
293 ;; Bug#31734
294 (let ((variable 0))
295 (cond
296 ((eq variable 'default)
297 (message "equal"))
298 (t
299 (message "not equal")))))
293 "List of expression for test. 300 "List of expression for test.
294Each element will be executed by interpreter and with 301Each element will be executed by interpreter and with
295bytecompiled code, and their results compared.") 302bytecompiled code, and their results compared.")