aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVibhav Pant2017-04-22 20:38:53 +0530
committerVibhav Pant2017-04-22 22:08:15 +0530
commit1c91bc9221d12618c9fb5507561dd35b7e392cb6 (patch)
tree515cbb3f08814413ef43359d047c5bd9273ea024
parentace38bafa6ae0d40bf3fac9f998c8ecbe36d5f41 (diff)
downloademacs-1c91bc9221d12618c9fb5507561dd35b7e392cb6.tar.gz
emacs-1c91bc9221d12618c9fb5507561dd35b7e392cb6.zip
b-c--cond-jump-table-info: Use correct body for singleton clauses
* lisp/emacs-lisp/bytecomp.el (byte-compile-cond-jump-table-info): When a clause's body consists of a single constant expression, use that expression as the body to be compiled. This fixes switch bytecode evaluating to nil to such clauses.
-rw-r--r--lisp/emacs-lisp/bytecomp.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index aba07102055..15dc24060aa 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4066,8 +4066,8 @@ Return a list of the form ((TEST . VAR) ((VALUE BODY) ...))"
4066 ;; discard duplicate clauses 4066 ;; discard duplicate clauses
4067 (not (assq obj2 cases))) 4067 (not (assq obj2 cases)))
4068 (push (list (if (consp obj2) (eval obj2) obj2) body) cases) 4068 (push (list (if (consp obj2) (eval obj2) obj2) body) cases)
4069 (if (eq condition t) 4069 (if (and (macroexp-const-p condition) condition)
4070 (progn (push (list 'default body) cases) 4070 (progn (push (list 'default (or body `(,condition))) cases)
4071 (throw 'break t)) 4071 (throw 'break t))
4072 (setq ok nil) 4072 (setq ok nil)
4073 (throw 'break nil)))))) 4073 (throw 'break nil))))))