From: Nikodemus Siivola Date: Fri, 3 Oct 2008 18:28:48 +0000 (+0000) Subject: 1.0.21.2: ADJUST-ARRAY should not make multidimensional arrays have fill-pointers X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=138316f3ffc98856be1f63ad29f8b28b7e89547f;p=sbcl.git 1.0.21.2: ADJUST-ARRAY should not make multidimensional arrays have fill-pointers * ADJUST-ARRAY used to give multidimensional arrays a bogus fill-pointer unless :INITIAL-CONTENTS or :DISPLACED-TO were given. Reported by Cedric St-Jean on sbcl-devel. --- diff --git a/NEWS b/NEWS index a0ce8f4..4e53c41 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,12 @@ ;;;; -*- coding: utf-8; -*- +changes in sbcl-1.0.22 relative to 1.0.21: + * bug fix: ADJUST-ARRAY on multidimensional arrays used bogusly give + them a fill pointer unless :DISPLACED-TO or :INITIAL-CONTENTS were + provided. (reported by Cedric St-Jean) + +changes in sbcl-1.0.21 relative to 1.0.20: + * new feature: the compiler is able to track the effective type of a + generic function across method addition and removal. * new feature: SB-EXT:ATOMIC-INCF allows atomic incrementation of appropriately typed structure slots without locking. * new feature: SB-EXT:CALL-WITH-TIMING provides access to timing @@ -22,8 +30,6 @@ given mixed integer and double-float arguments, leading to better precision. (reported by Bob Felts) * bug fix: LOG with base zero returned values of inconsistent type. - * new feature: have the compiler track the effective type of a generic - function across method addition and removal. changes in sbcl-1.0.20 relative to 1.0.19: * minor incompatible change: OPTIMIZE qualities diff --git a/src/code/array.lisp b/src/code/array.lisp index 60a2f0b..34de463 100644 --- a/src/code/array.lisp +++ b/src/code/array.lisp @@ -979,12 +979,12 @@ of specialized arrays is supported." initial-element-p)) (if (adjustable-array-p array) (set-array-header array new-data new-length - new-length 0 dimensions nil) + nil 0 dimensions nil) (let ((new-array (make-array-header sb!vm:simple-array-widetag array-rank))) (set-array-header new-array new-data new-length - new-length 0 dimensions nil))))))))))) + nil 0 dimensions nil))))))))))) (defun get-new-fill-pointer (old-array new-array-size fill-pointer) diff --git a/tests/array.pure.lisp b/tests/array.pure.lisp index d04416d..9919eb7 100644 --- a/tests/array.pure.lisp +++ b/tests/array.pure.lisp @@ -210,14 +210,19 @@ 'bit-vector) do (assert (bit-vector-equal r1 r2))))) -;;; CLHS, ADJUST-ARRAY: An error of type error is signaled if -;;; fill-pointer is supplied and non-nil but array has no fill pointer. -(assert (eq :good - (handler-case - (let ((array (make-array 12))) - (assert (not (array-has-fill-pointer-p array))) - (adjust-array array 12 :fill-pointer t) - array) - (type-error () - :good)))) - +(with-test (:name (adjust-array fill-pointer)) + ;; CLHS, ADJUST-ARRAY: An error of type error is signaled if + ;; fill-pointer is supplied and non-nil but array has no fill pointer. + (assert (eq :good + (handler-case + (let ((array (make-array 12))) + (assert (not (array-has-fill-pointer-p array))) + (adjust-array array 12 :fill-pointer t) + array) + (type-error () + :good))))) + +(with-test (:name (adjust-array multidimensional)) + (let ((ary (make-array '(2 2)))) + ;; SBCL used to give multidimensional arrays a bogus fill-pointer + (assert (not (array-has-fill-pointer-p (adjust-array ary '(2 2))))))) diff --git a/version.lisp-expr b/version.lisp-expr index f045380..59dde7a 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.21.1" +"1.0.21.2"