summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPaul Eggert <eggert@Penguin.CS.UCLA.EDU>2018-06-16 07:44:58 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-06-16 07:48:51 -0700
commit9af399fd803ac1ca79f319945b9745b5b96122e7 (patch)
tree64d52ed4243fb0622771c2cbcef64c01c5d420d7 /test/lisp/emacs-lisp
parent34e257f83a22093cc8dd7a6cd8a4707123f5af77 (diff)
downloademacs-9af399fd803ac1ca79f319945b9745b5b96122e7.tar.gz
emacs-9af399fd803ac1ca79f319945b9745b5b96122e7.tar.bz2
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/lisp/emacs-lisp')
-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 @@
(t)))
(let ((a))
(cond ((eq a 'foo) 'incorrect)
- ('correct))))
+ ('correct)))
+ ;; Bug#31734
+ (let ((variable 0))
+ (cond
+ ((eq variable 'default)
+ (message "equal"))
+ (t
+ (message "not equal")))))
"List of expression for test.
Each element will be executed by interpreter and with
bytecompiled code, and their results compared.")