diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2022-12-24 10:39:57 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2022-12-24 11:55:40 +0100 |
commit | 1748361c68aeb3e18e6007369f153657227e6059 (patch) | |
tree | 1ebf9ce1d1f4936548f0cf577abf99194dd6a564 /test/lisp/emacs-lisp/bytecomp-tests.el | |
parent | 8bb8cc5b49a0cb681327ce9abe38266d5e26d19c (diff) | |
download | emacs-1748361c68aeb3e18e6007369f153657227e6059.tar.gz emacs-1748361c68aeb3e18e6007369f153657227e6059.tar.bz2 emacs-1748361c68aeb3e18e6007369f153657227e6059.zip |
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.
Diffstat (limited to 'test/lisp/emacs-lisp/bytecomp-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 36f541e867c..47200de7a02 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -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.") |