aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVibhav Pant2017-02-05 15:37:43 +0530
committerVibhav Pant2017-02-05 15:37:43 +0530
commit44c95c58b26b7b9d75965a83930ec3d77ffae28f (patch)
treea652633e546631456a2f7bbb23e70e19d6a1cb5e
parentde456d1e4a1d7e34be6d040e0d8a04c42b14e62e (diff)
downloademacs-44c95c58b26b7b9d75965a83930ec3d77ffae28f.tar.gz
emacs-44c95c58b26b7b9d75965a83930ec3d77ffae28f.zip
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.
-rw-r--r--lisp/emacs-lisp/bytecomp.el12
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."
3971 (setq byte-compile--for-effect nil)) 3971 (setq byte-compile--for-effect nil))
3972 3972
3973(defun byte-compile-cond-valid-obj2-p (obj) 3973(defun byte-compile-cond-valid-obj2-p (obj)
3974 (if (consp obj) 3974 (cond
3975 (and (eq (car obj) 'quote) 3975 ((consp obj)
3976 (= (length obj) 2) 3976 (and (eq (car obj) 'quote)
3977 (symbolp (cadr obj))) 3977 (= (length obj) 2)
3978 t)) 3978 (symbolp (cadr obj))))
3979 ((symbolp obj) (keywordp obj))
3980 (t t)))
3979 3981
3980(defun byte-compile-cond-vars (obj1 obj2) 3982(defun byte-compile-cond-vars (obj1 obj2)
3981 (or 3983 (or