1.0.43.72: fix regression from 1.0.43.64
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 19 Oct 2010 10:24:01 +0000 (10:24 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 19 Oct 2010 10:24:01 +0000 (10:24 +0000)
 As usual, the original patch was fine, and it was my edits that
 wrecked havoc...

 Move DTYPE initialization to its proper place: LOOP-OPTIONAL-TYPE has
 side-effects and so cannot be called in the place where I so blithely
 moved it.

 Closes bug 654220 again.

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

index 1af7d78..969475a 100644 (file)
@@ -1161,7 +1161,6 @@ code to be loaded.
 
 (defun loop-get-collection-info (collector class default-type)
   (let ((form (loop-get-form))
-        (dtype (or (loop-optional-type) default-type))
         (name (when (loop-tequal (car *loop-source-code*) 'into)
                 (loop-pop-source)
                 (loop-pop-source))))
@@ -1169,7 +1168,8 @@ code to be loaded.
       (loop-error "The value accumulation recipient name, ~S, is not a symbol." name))
     (unless name
       (loop-disallow-aggregate-booleans))
-    (let ((cruft (find (the symbol name) *loop-collection-cruft*
+    (let ((dtype (or (loop-optional-type) default-type))
+          (cruft (find (the symbol name) *loop-collection-cruft*
                        :key #'loop-collector-name)))
       (cond ((not cruft)
              (when (and name (loop-var-p name))
index 804cac0..9e6a2db 100644 (file)
     (assert (null warnings-p))
     (assert (null failure-p))
     (assert (equal '(t t) (funcall function)))))
+
+(with-test (:name :bug-654220-regression)
+  (assert (= 32640 (loop for i to 255
+                         sum i into sum of-type fixnum
+                         finally (return sum)))))
index 2cac2d3..b1e5b2b 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.43.71"
+"1.0.43.72"