1.0.36.26: bug using OF-TYPE VECTOR in LOOP
authorNikodemus Siivola <nikodemus@random-state.net>
Wed, 17 Mar 2010 11:53:29 +0000 (11:53 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 17 Mar 2010 11:53:29 +0000 (11:53 +0000)
 Case of :ELEMENT-TYPE * vs T confusion.

 Fixes launchpad bug #540186.

NEWS
src/code/loop.lisp
tests/loop.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 5a97866..c91a356 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -37,7 +37,7 @@ changes relative to sbcl-1.0.36:
     SB-EXT:RESTRICT-COMPILER-POLICY into account. (lp#313337)
   * bug fix: Comma inside a backquoted array or structure resulted in nonsense
     values instead of signaling an error. (lp#309093)
-  * bug fix: Spurious unused variale warning in a DEFSTRUCT edge case.
+  * bug fix: Spurious unused variable warning in a DEFSTRUCT edge case.
     (lp#528807)
   * bug fix: More consistent warnings and notes for ignored DYNAMIC-EXTENT
     declarations (lp#497321)
@@ -45,6 +45,7 @@ changes relative to sbcl-1.0.36:
     and failed to detect circular lists (lp#452008)
   * bug fix: leakage from ~/.asdf-install into the ASDf-INSTALL contrib build
     (lp#538974)
+  * bug fix: LOOP OF-TYPE VECTOR compile-time error. (lp#540186)
 
 changes in sbcl-1.0.36 relative to sbcl-1.0.35:
   * new feature: SB-EXT:TYPEXPAND-1, SB-EXT:TYPEXPAND, and
index e2df9b8..eea95f8 100644 (file)
@@ -938,7 +938,8 @@ code to be loaded.
         ((sb!xc:subtypep data-type 'vector)
          (let ((ctype (sb!kernel:specifier-type data-type)))
            (when (sb!kernel:array-type-p ctype)
-             (let ((etype (sb!kernel:array-type-element-type ctype)))
+             (let ((etype (sb!kernel:type-*-to-t
+                           (sb!kernel:array-type-specialized-element-type ctype))))
                (make-array 0 :element-type (sb!kernel:type-specifier etype))))))
         (t
          nil)))
index 44853c9..84a833a 100644 (file)
 (loop with x of-type (simple-vector 1) = (make-array '(1))
       repeat 1
       return x)
+
+(with-test (:name :bug-540186)
+  (let ((fun (compile nil `(lambda (x)
+                             (loop for i from 0 below (length x)
+                                   for vec of-type vector = (aref x i)
+                                   collect vec)))))
+    (assert (equal '("foo" "bar")
+             (funcall fun
+                      (vector "foo" "bar"))))))
index 240c8c6..198ef83 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.36.25"
+"1.0.36.26"