1.0.23.4: fix error signalling from (SETF FILL-POINTER)
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 1 Dec 2008 15:44:41 +0000 (15:44 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Mon, 1 Dec 2008 15:44:41 +0000 (15:44 +0000)
 * Thanks to Stas Boukarev.

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

diff --git a/NEWS b/NEWS
index 443a38b..1e2de05 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@
     SB-CLTL2. (reported by Larry D'Anna)
   * bug fix: STRING-TO-OCTETS did not handle :START properly when
     using UTF-8 as external format. (thanks to Luis Oliveira)
+  * bug fix: errors from invalid fill-pointer values to (SETF FILL-POINTER)
+    are signalled correctly. (thanks to Stas Boukarev)
 
 changes in sbcl-1.0.23 relative to 1.0.22:
   * enhancement: when disassembling method functions, disassembly
index 34de463..7c2790e 100644 (file)
@@ -776,7 +776,7 @@ of specialized arrays is supported."
                   :datum arg
                   :expected-type (list 'integer 0 max)
                   :format-control "The new fill pointer, ~S, is larger than the length of the vector (~S.)"
-                  arg max)))
+                  :format-arguments (list arg max))))
         (t
          (error 'simple-type-error
                 :datum vector
index 7760a6c..31975cc 100644 (file)
   (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)))))))
+
+(with-test (:name %set-fill-pointer/error)
+  (let ((v (make-array 3 :fill-pointer 0))) 
+    (handler-case
+        (progn
+          (setf (fill-pointer v) 12)
+          (error "WTF"))
+      (error (e)
+        (assert (eql 12 (type-error-datum e)))
+        (assert (equal '(integer 0 3) (type-error-expected-type e)))))))
index 82d37e0..fbf898b 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.23.3"
+"1.0.23.4"