diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2019-05-17 11:25:06 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2019-05-27 13:25:27 +0200 |
commit | 68b374a62d8b7b98fd0b144ae83077d698e20bdb (patch) | |
tree | e67783a51e27c314b7ddbc734b865beba0c8913a /test/lisp/autorevert-tests.el | |
parent | 457b02440510a594e3ff6f17cc6846a3a467a6a1 (diff) | |
download | emacs-68b374a62d8b7b98fd0b144ae83077d698e20bdb.tar.gz emacs-68b374a62d8b7b98fd0b144ae83077d698e20bdb.tar.bz2 emacs-68b374a62d8b7b98fd0b144ae83077d698e20bdb.zip |
Correctly eliminate duplicate cases in switch compilation
Fix code mistakes that prevented the correct elimination of duplicated
cases when compiling a `cond' form to a switch bytecode, as in
(cond ((eq x 'a) 1)
((eq x 'b) 2)
((eq x 'a) 3) ; should be elided
((eq x 'c) 4))
Sometimes, this caused the bytecode to use the wrong branch (bug#35770).
* lisp/emacs-lisp/bytecomp.el (byte-compile-cond-vars): Return obj2 eval'ed.
(byte-compile-cond-jump-table-info):
Discard redundant condition. Use `obj2' as evaluated.
Discard duplicated cases instead of failing the table generation.
* test/lisp/emacs-lisp/bytecomp-tests.el (toplevel): Require subr-x.
(byte-opt-testsuite-arith-data, bytecomp-test--switch-duplicates): Test.
Diffstat (limited to 'test/lisp/autorevert-tests.el')
0 files changed, 0 insertions, 0 deletions