From 34a6f9c3f9d476e766c45fcfcad80c8926ebd7c1 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Mon, 30 Aug 2010 11:13:18 +0000 Subject: [PATCH] 1.0.42.3: DOTIMES and non-integer counts * 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 | 2 ++ src/code/defboot.lisp | 2 +- tests/compiler.pure.lisp | 3 +++ version.lisp-expr | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index f33c0ab..c97dbeb 100644 --- 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 diff --git a/src/code/defboot.lisp b/src/code/defboot.lisp index 4147b0e..e04a89d 100644 --- a/src/code/defboot.lisp +++ b/src/code/defboot.lisp @@ -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)) diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index c008f31..52187e5 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -3531,3 +3531,6 @@ (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))) diff --git a/version.lisp-expr b/version.lisp-expr index 8091c7a..e7339d5 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.42.2" +"1.0.42.3" -- 1.7.10.4