From: Nikodemus Siivola Date: Tue, 19 Oct 2010 10:24:01 +0000 (+0000) Subject: 1.0.43.72: fix regression from 1.0.43.64 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=c3bf5a0037aea195f13c14fb79d096b9677d0345;p=sbcl.git 1.0.43.72: fix regression from 1.0.43.64 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. --- diff --git a/src/code/loop.lisp b/src/code/loop.lisp index 1af7d78..969475a 100644 --- a/src/code/loop.lisp +++ b/src/code/loop.lisp @@ -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)) diff --git a/tests/loop.pure.lisp b/tests/loop.pure.lisp index 804cac0..9e6a2db 100644 --- a/tests/loop.pure.lisp +++ b/tests/loop.pure.lisp @@ -268,3 +268,8 @@ (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))))) diff --git a/version.lisp-expr b/version.lisp-expr index 2cac2d3..b1e5b2b 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"