[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-commits
Subject:    [Sbcl-commits] master: Don't ignore invalid COND clauses following a T clause.
From:       "stassats" <stassats () users ! sourceforge ! net>
Date:       2015-12-30 9:25:09
Message-ID: E1aED0L-0003wR-6t () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

The branch "master" has been updated in SBCL:
       via  654f7a98d58e1b35def8ccef056f650ea4a3e70b (commit)
      from  a42d894c0d3d258811ff5bdac78e126eb149a52b (commit)

- Log -----------------------------------------------------------------
commit 654f7a98d58e1b35def8ccef056f650ea4a3e70b
Author: Stas Boukarev <stassats@gmail.com>
Date:   Wed Dec 30 12:23:57 2015 +0300

    Don't ignore invalid COND clauses following a T clause.
    
    (cond (t 10) 20) was accepted and returned 10.
---
 src/code/defboot.lisp    |    7 ++-----
 tests/compiler.pure.lisp |    5 +++++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/code/defboot.lisp b/src/code/defboot.lisp
index bd08a7c..3e8ad92 100644
--- a/src/code/defboot.lisp
+++ b/src/code/defboot.lisp
@@ -85,13 +85,10 @@
                        (if ,n-result
                            ,n-result
                            (cond ,@more))))
-                  (if (eq t test)
+                  (if (and (eq test t)
+                           (not more))
                       ;; THE to preserve non-toplevelness for FOO in
                       ;;   (COND (T (FOO)))
-                      ;; FIXME: this hides all other possible stylistic issues,
-                      ;; not the least of which is a code deletion note,
-                      ;; if there are forms following the one whose head is T.
-                      ;; This is not usually the SBCL preferred way.
                       `(the t (progn ,@forms))
                       `(if ,test
                            (progn ,@forms)
diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp
index 30fed6a..3c7dab3 100644
--- a/tests/compiler.pure.lisp
+++ b/tests/compiler.pure.lisp
@@ -5736,3 +5736,8 @@
             :skipped-on '(not :64-bit))
  (checked-compile `(lambda ()
                      (make-list (expt 2 30) :initial-element 0))))
+
+(with-test (:name :bad-cond)
+  (assert-error
+   (checked-compile
+    '(lambda () (cond (t 10) 20)))))

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


hooks/post-receive
-- 
SBCL

------------------------------------------------------------------------------
_______________________________________________
Sbcl-commits mailing list
Sbcl-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic