1.0.42.3: DOTIMES and non-integer counts
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 30 Aug 2010 11:13:18 +0000 (11:13 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Mon, 30 Aug 2010 11:13:18 +0000 (11:13 +0000)
 * For non-literal non-integer counts we already did the right thing,
   but eg. literal floats slipped under the radar.

 * Patch by Roman Marynchak, lp#619393.

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

diff --git a/NEWS b/NEWS
index f33c0ab..c97dbeb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ changes relative to sbcl-1.0.42
   * bug fix: bogus type errors from (AREF A (+ POSITIVE-OFFSET N)) under
     certain circumstances when N was negative but (+ POSITIVE-OFFSET N)
     was non-negative. (lp#622958)
+  * bug fix: DOTIMES accepted literal non-integer reals. (lp#619393, thanks to
+    Roman Marynchak)
 
 changes in sbcl-1.0.42 relative to sbcl-1.0.41
   * build changes
index 4147b0e..e04a89d 100644 (file)
@@ -328,7 +328,7 @@ evaluated as a PROGN."
 ;;; ASAP, at the cost of being unable to use the standard
 ;;; destructuring mechanisms.
 (defmacro-mundanely dotimes ((var count &optional (result nil)) &body body)
-  (cond ((numberp count)
+  (cond ((integerp count)
         `(do ((,var 0 (1+ ,var)))
              ((>= ,var ,count) ,result)
            (declare (type unsigned-byte ,var))
index c008f31..52187e5 100644 (file)
                            (loop for n from (+ most-positive-fixnum 1) upto (+ most-positive-fixnum 7)
                                  collect (aref table (- n (+ most-positive-fixnum 1)))))))))
     (assert (equal '(0 1 2 3 4 5 6) (funcall fun)))))
+
+(with-test (:name :dotimes-non-integer-counter-value)
+  (assert (raises-error? (dotimes (i 8.6)) type-error)))
index 8091c7a..e7339d5 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.42.2"
+"1.0.42.3"