master: Fix EQUALP to EQUAL lowering for constant dotted lists

stassats via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  36c8443d71c10920f798fd712c21777b7e10dd94 (commit)
      from  01ab3579451ff4fc3c046542da3cf6390b0c20b6 (commit)

- Log -----------------------------------------------------------------
commit 36c8443d71c10920f798fd712c21777b7e10dd94
Author: Stas Boukarev <[email protected]>
Date:   Wed Apr 8 05:01:55 2026 +0300

    Fix EQUALP to EQUAL lowering for constant dotted lists
---
 src/compiler/srctran.lisp | 7 ++++---
 tests/seq.pure.lisp       | 8 ++++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp
index de3626fce..8031b83f6 100644
--- a/src/compiler/srctran.lisp
+++ b/src/compiler/srctran.lisp
@@ -6966,9 +6966,10 @@
                               (eq (car ,y) ',(car value))
                               (eq (cdr ,y) ',(cdr value))))
                        ((and (proper-or-dotted-list-p value)
-                             (loop with cdr = value
-                                   while (consp cdr)
-                                   always (symbolp (pop cdr))))
+                             (let ((cdr value))
+                               (and (loop while (consp cdr)
+                                          always (symbolp (pop cdr)))
+                                    (symbolp cdr))))
                         `(equal x y))))))
            ;; (equalp x (list y))
            ;; (equalp x (cons car cdr))
diff --git a/tests/seq.pure.lisp b/tests/seq.pure.lisp
index 7eaa25266..661b4cd67 100644
--- a/tests/seq.pure.lisp
+++ b/tests/seq.pure.lisp
@@ -1119,3 +1119,11 @@
 (with-test (:name :make-sequence-non-simple)
   (assert-error (make-sequence '(and vector (not simple-array)) 10)
       type-error))
+
+(with-test (:name :equalp-to-equal)
+  (checked-compile-and-assert
+      ()
+      `(lambda (l)
+         (equalp l '(A . "FOO")))
+    (('(A . "FoO")) t)
+    (('(B . "FOO")) nil)))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.