From 20282f309195a58fd8b79bb2e1b3105da3ad3992 Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Sun, 22 Mar 2009 19:44:13 +0000 Subject: [PATCH] 1.0.26.12: Don't allow (LOOP FOR X ACROSS A ...) where A evaluates to NIL * Patch by Daniel Lowe --- NEWS | 4 ++++ src/code/loop.lisp | 13 ++++++++++--- version.lisp-expr | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 7b9c56d..fedb224 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,8 @@ ;;;; -*- coding: utf-8; fill-column: 78 -*- +changes in sbcl-1.0.27 relative to 1.0.26: + * bug fix: a type error is signaled for attempts to use the LOOP + keyword ACROSS for a NIL value. (thanks to Daniel Lowe) + changes in sbcl-1.0.26 relative to 1.0.25: * incompatible change: an interruption (be it a function passed to INTERRUPT-THREAD or a timer function) runs in an environment where diff --git a/src/code/loop.lisp b/src/code/loop.lisp index 6b9a43a..565ab9a 100644 --- a/src/code/loop.lisp +++ b/src/code/loop.lisp @@ -916,8 +916,11 @@ code to be loaded. ;;;; loop types (defun loop-typed-init (data-type &optional step-var-p) - (when (and data-type (sb!xc:subtypep data-type 'number)) - (let ((init (if step-var-p 1 0))) + (cond + ((null data-type) + nil) + ((sb!xc:subtypep data-type 'number) + (let ((init (if step-var-p 1 0))) (flet ((like (&rest types) (coerce init (find-if (lambda (type) (sb!xc:subtypep data-type type)) @@ -932,7 +935,11 @@ code to be loaded. '(complex long-float) '(complex float))) (t - init)))))) + init))))) + ((sb!xc:subtypep data-type 'vector) + (coerce nil data-type)) + (t + nil))) (defun loop-optional-type (&optional variable) ;; No variable specified implies that no destructuring is permissible. diff --git a/version.lisp-expr b/version.lisp-expr index 930910c..e8eefd7 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.26.11" +"1.0.26.12" -- 1.7.10.4