emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] feature/byte-switch 44c95c5: bytecomp.el: Don't store non-


From: Vibhav Pant
Subject: [Emacs-diffs] feature/byte-switch 44c95c5: bytecomp.el: Don't store non-keyword symbols in jump-tables.
Date: Sun, 5 Feb 2017 10:23:02 +0000 (UTC)

branch: feature/byte-switch
commit 44c95c58b26b7b9d75965a83930ec3d77ffae28f
Author: Vibhav Pant <address@hidden>
Commit: Vibhav Pant <address@hidden>

    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.
---
 lisp/emacs-lisp/bytecomp.el |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 53622a4..b7852c5 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]