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.
This commit is contained in:
Vibhav Pant 2017-02-05 15:37:43 +05:30
parent de456d1e4a
commit 44c95c58b2

View file

@ -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