1.0.27.26: fix invalid array index reporting for compiled code
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 23 Apr 2009 12:26:56 +0000 (12:26 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 23 Apr 2009 12:26:56 +0000 (12:26 +0000)
 * Index and bound were swapped around.

 * Also fix the name in the type declamation for INVALID-ARRAY-INDEX-ERROR.

   Thanks to Stas Boukarev.

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

diff --git a/NEWS b/NEWS
index 66b429c..2b85056 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 ;;;; -*- coding: utf-8; fill-column: 78 -*-
 changes in sbcl-1.0.28 relative to 1.0.27:
+  * bug fix: some error messages for out-of-bound array indexes confused the
+    index and the bound. (thanks to Stas Boukarev)
   * bug fix: pretty printing malformed DEFPACKAGE forms (thanks to Sidney
     Markowitz)
   * bug fix: running regressions tests in shells without OSTYPE set now works.
index 1df47c5..2d4ab67 100644 (file)
@@ -476,7 +476,8 @@ of specialized arrays is supported."
 (defun data-vector-ref-with-offset (array index offset)
   (hairy-data-vector-ref array (+ index offset)))
 
-(declaim (ftype (function (array integer integer &optional t) nil) signal-invalid-array-index-error))
+(declaim (ftype (function (array integer integer &optional t) nil)
+                invalid-array-index-error))
 (defun invalid-array-index-error (array index bound &optional axis)
   (error 'invalid-array-index-error
          :array array
index 9014b56..b712ad8 100644 (file)
          :format-arguments (list key-name)))
 
 (deferr invalid-array-index-error (array bound index)
-  (invalid-array-index-error array bound index))
+  (invalid-array-index-error array index bound))
 
 (deferr object-not-simple-array-error (object)
   (error 'type-error
index 7f5c11f..0cf064f 100644 (file)
                         (= 3 (type-error-datum e))
                         (equal '(integer 0 (3)) (type-error-expected-type e)))
                :right)))))))
+
+(with-test (:name :out-of-bounds-error-details)
+  (assert (eq :good
+              (handler-case
+                  (flet ((test (array i)
+                           (aref array i)))
+                    (test (eval '(vector 0 1 2 3)) 6))
+                (sb-int:invalid-array-index-error (e)
+                  (when (and (equal '(integer 0 (4))
+                                    (type-error-expected-type e))
+                             (eql 6 (type-error-datum e)))
+                    :good))))))
+
index b129e80..a6f8f39 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.27.25"
+"1.0.27.26"