diff options
author | Vibhav Pant <vibhavp@gmail.com> | 2017-02-05 15:37:43 +0530 |
---|---|---|
committer | Vibhav Pant <vibhavp@gmail.com> | 2017-02-05 15:37:43 +0530 |
commit | 44c95c58b26b7b9d75965a83930ec3d77ffae28f (patch) | |
tree | a652633e546631456a2f7bbb23e70e19d6a1cb5e /lisp/emacs-lisp/bytecomp.el | |
parent | de456d1e4a1d7e34be6d040e0d8a04c42b14e62e (diff) | |
download | emacs-44c95c58b26b7b9d75965a83930ec3d77ffae28f.tar.gz |
bytecomp.el: Don't store non-keyword symbols in jump-tables.
* lisp/emacs-lisp/bytecomp.el (byte-compile-cond-valid-obj2-p) return
nil when OBJ is a non-keyword symbol (i.e a variable), as the jump
table can only be used when comparing variables with constant values.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 53622a47d7a..b7852c57ebf 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3971,11 +3971,13 @@ that suppresses all warnings during execution of BODY." (setq byte-compile--for-effect nil)) (defun byte-compile-cond-valid-obj2-p (obj) - (if (consp obj) - (and (eq (car obj) 'quote) - (= (length obj) 2) - (symbolp (cadr obj))) - t)) + (cond + ((consp obj) + (and (eq (car obj) 'quote) + (= (length obj) 2) + (symbolp (cadr obj)))) + ((symbolp obj) (keywordp obj)) + (t t))) (defun byte-compile-cond-vars (obj1 obj2) (or |