1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 02:31:03 -08:00

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)) (setq byte-compile--for-effect nil))
(defun byte-compile-cond-valid-obj2-p (obj) (defun byte-compile-cond-valid-obj2-p (obj)
(if (consp obj) (cond
(and (eq (car obj) 'quote) ((consp obj)
(= (length obj) 2) (and (eq (car obj) 'quote)
(symbolp (cadr obj))) (= (length obj) 2)
t)) (symbolp (cadr obj))))
((symbolp obj) (keywordp obj))
(t t)))
(defun byte-compile-cond-vars (obj1 obj2) (defun byte-compile-cond-vars (obj1 obj2)
(or (or