summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2021-04-09 18:59:09 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2021-04-09 19:20:55 +0200
commit59342f689eaa4839b0fc15351ae48b4f1074a6fc (patch)
treed0778dc9d0ce81fba4ec9e8b36797ce946d73497 /test/lisp/emacs-lisp
parentb7a7e879d02570cbf74aa87686b6b0ed4e6b0c3b (diff)
downloademacs-59342f689eaa4839b0fc15351ae48b4f1074a6fc.tar.gz
emacs-59342f689eaa4839b0fc15351ae48b4f1074a6fc.tar.bz2
emacs-59342f689eaa4839b0fc15351ae48b4f1074a6fc.zip
Fix condition-case optimiser bug
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't perform incorrect optimisations when a condition-case variable shadows another lexical variable. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): New test case.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 1953878d6f5..94e33a7770e 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -431,6 +431,12 @@
(let ((x 2))
(list (or (bytecomp-test-identity 'a) (setq x 3)) x))
+
+ (let* ((x 1)
+ (y (condition-case x
+ (/ 1 0)
+ (arith-error x))))
+ (list x y))
)
"List of expressions for cross-testing interpreted and compiled code.")