changeset 5917:ffb5abc8dc4e

Fix a bug in the #'equalp compiler macro. lisp/ChangeLog addition: 2015-06-11 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el (equalp): Fix a bug in this compiler macro when passed constants in a certain order. tests/ChangeLog addition: 2015-06-11 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Add a test looking for a bug just fixed in the equalp compiler macro.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 11 Jun 2015 16:09:11 +0100
parents 1152e0091f8c
children cb65bfaf7110
files lisp/ChangeLog lisp/cl-macs.el tests/ChangeLog tests/automated/lisp-tests.el
diffstat 4 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Jun 03 20:13:07 2015 +0100
+++ b/lisp/ChangeLog	Thu Jun 11 16:09:11 2015 +0100
@@ -1,3 +1,9 @@
+2015-06-11  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-macs.el (equalp):
+	Fix a bug in this compiler macro when passed constants in a
+	certain order.
+
 2015-06-03  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* code-files.el (load):
--- a/lisp/cl-macs.el	Wed Jun 03 20:13:07 2015 +0100
+++ b/lisp/cl-macs.el	Thu Jun 11 16:09:11 2015 +0100
@@ -3722,8 +3722,7 @@
 	   ;; zero-length.
 	   (cond
 	    ((member x '("" #* []))
-	     ;; No need to protect against multiple evaluation here:
-	     `(and (member ,original-y '("" #* [])) t))
+	     `(and (member ,(find x (cdr form) :test-not #'eq) '("" #* [])) t))
 	    (t form)))
 	  ((unordered-check (and (numberp x) (not (cl-const-expr-p y))))
 	   `(,@let-form
--- a/tests/ChangeLog	Wed Jun 03 20:13:07 2015 +0100
+++ b/tests/ChangeLog	Thu Jun 11 16:09:11 2015 +0100
@@ -1,3 +1,9 @@
+2015-06-11  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/lisp-tests.el:
+	Add a test looking for a bug just fixed in the equalp compiler
+	macro.
+
 2015-06-03  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* automated/file-tests.el:
--- a/tests/automated/lisp-tests.el	Wed Jun 03 20:13:07 2015 +0100
+++ b/tests/automated/lisp-tests.el	Thu Jun 11 16:09:11 2015 +0100
@@ -2390,6 +2390,8 @@
 
     (Assert-equalp "hi there" "Hi There"
                    "checking equalp isn't case-sensitive")
+    (Assert (not (equalp (emacs-version) #*))
+	    "checking a bug with constants and equalp is fixed.")
     (Assert-equalp
      99 99.0
      "checking equalp compares numerical values of different types")