diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2021-07-27 17:26:26 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2021-07-27 17:32:23 +0200 |
commit | 949dd41c31dab69f7a5067bba324c28bb2cfbf8e (patch) | |
tree | 4bded5ff6a4692a1f41dd678a41a29caf34b19b6 /lisp/emacs-lisp | |
parent | 989937e1bc29ffec3835aee34c46479d25d0bf05 (diff) | |
download | emacs-949dd41c31dab69f7a5067bba324c28bb2cfbf8e.tar.gz emacs-949dd41c31dab69f7a5067bba324c28bb2cfbf8e.tar.bz2 emacs-949dd41c31dab69f7a5067bba324c28bb2cfbf8e.zip |
Fix mistake in switch-case generation of `null` (bug#49746)
Reported by Gregor Zattler.
* lisp/emacs-lisp/bytecomp.el (byte-compile--cond-switch-prefix):
Be more careful in the selection of equality.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f6150069e81..1b64a06fe42 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -4362,7 +4362,8 @@ Return (TAIL VAR TEST CASES), where: (and (or (eq var switch-var) (not switch-var)) (progn (setq switch-var var) - (setq switch-test 'eq) + (setq switch-test + (byte-compile--common-test switch-test 'eq)) (unless (memq nil keys) (push nil keys) (push (cons (list nil) (or body '(t))) cases)) |