1.0.21.2: ADJUST-ARRAY should not make multidimensional arrays have fill-pointers
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 3 Oct 2008 18:28:48 +0000 (18:28 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 3 Oct 2008 18:28:48 +0000 (18:28 +0000)
 * 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.

NEWS
src/code/array.lisp
tests/array.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index a0ce8f4..4e53c41 100644 (file)
--- 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
index 60a2f0b..34de463 100644 (file)
@@ -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)
index d04416d..9919eb7 100644 (file)
                            '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)))))))
index f045380..59dde7a 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.21.1"
+"1.0.21.2"