From 949dd41c31dab69f7a5067bba324c28bb2cfbf8e Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Tue, 27 Jul 2021 17:26:26 +0200 Subject: 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. --- lisp/emacs-lisp/bytecomp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/bytecomp.el') 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)) -- cgit v1.2.3