]> git.eshelyaron.com Git - emacs.git/commit
Fix condition-case body for-effect miscompilation
authorMattias Engdegård <mattiase@acm.org>
Fri, 23 Dec 2022 19:04:22 +0000 (20:04 +0100)
committerMattias Engdegård <mattiase@acm.org>
Sat, 24 Dec 2022 10:54:47 +0000 (11:54 +0100)
commit8bb8cc5b49a0cb681327ce9abe38266d5e26d19c
treecefdb13a4683c8325fe84f08b68bfb5b6b81ff14
parentcc2cc0c2971bf867283d1478bd0d99c2f420f982
Fix condition-case body for-effect miscompilation

(condition-case x A (:success B)) should not compile A for-effect even
if the entire form is in for-effect context.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't optimise the condition-case body form for effect (potentially
discarding its value) if there is a success handler and a variable.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
lisp/emacs-lisp/byte-opt.el
test/lisp/emacs-lisp/bytecomp-tests.el