1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 02:51:31 -08:00

Fix condition-case empty success handler misinterpretation

(condition-case X E (:success)) should return nil; the compiler
behaves correctly in this case.

* src/eval.c (internal_lisp_condition_case):
Evaluate an empty :success handler as nil instead of pretending it
isn't there.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
This commit is contained in:
Mattias Engdegård 2022-12-24 10:39:57 +01:00
parent 8bb8cc5b49
commit 1748361c68
2 changed files with 8 additions and 3 deletions

View file

@ -752,6 +752,11 @@ inner loops respectively."
(condition-case nil
(characterp x) ; value (no :success, no var)
(error 'bad)))
(condition-case nil
(bytecomp-test-identity 3)
(error 'bad)
(:success)) ; empty handler
)
"List of expressions for cross-testing interpreted and compiled code.")