1.0.19.30: muffle code deletion note from destructuring-bind
authorNikodemus Siivola <nikodemus@random-state.net>
Sun, 17 Aug 2008 09:28:10 +0000 (09:28 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Sun, 17 Aug 2008 09:28:10 +0000 (09:28 +0000)
 * Was emitted when destructuring constant lists.

NEWS
src/code/parse-defmacro.lisp
tests/compiler.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 0cfec02..1cc248c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,9 @@ changes in sbcl-1.0.20 relative to 1.0.19:
     work. (thanks to Alec Berryman)
   * optimization: REPLACE deftransforms don't punt when :START1 or
     :START2 is given
+  * bug fix: compiling DESTRUCTURING-BIND on constant list arguments
+    no longer emits a code deletion note. (reported by Andrew
+    Gasparovic)
   * bug fix: bogus odd-number-of-keywords STYLE-WARNINGs from calls to
     functions with an odd number of &OPTIONAL arguments, a &REST
     argument, and one or more &KEY arguments at the call site.
index 613f9c0..bc233ba 100644 (file)
@@ -51,6 +51,8 @@
                                       :error-fun error-fun
                                       :anonymousp anonymousp)
         (values `(let* (,@(nreverse *system-lets*))
+                   #-sb-xc-host
+                   (declare (muffle-conditions sb!ext:code-deletion-note))
                    ,@(when *ignorable-vars*
                        `((declare (ignorable ,@*ignorable-vars*))))
                    ,@*arg-tests*
index c85ebd0..6fcfb21 100644 (file)
     (multiple-value-bind (res err) (ignore-errors (funcall fun nil))
       (assert (not res))
       (assert (typep err 'type-error)))))
+
+(with-test (:name :constant-list-destructuring)
+  (handler-bind ((sb-ext:compiler-note #'error))
+    (progn
+      (assert (= 10
+                 (funcall
+                  (compile nil
+                           '(lambda ()
+                             (destructuring-bind (a (b c) d) '(1 (2 3) 4)
+                               (+ a b c d)))))))
+      (assert (eq :feh
+                  (funcall
+                   (compile nil
+                            '(lambda (x)
+                              (or x
+                               (destructuring-bind (a (b c) d) '(1 "foo" 4)
+                                 (+ a b c d)))))
+                   :feh))))))
index eb782f2..20751b5 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.19.29"
+"1.0.19.30"