Skip to content
Snippets Groups Projects
Commit 7aed608a authored by gerd's avatar gerd
Browse files

* src/code/array.lisp (%array-row-major-index): Signal

	type-error for invalid indices.
parent 1c1bbb6a
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/array.lisp,v 1.35 2003/05/05 12:04:26 emarsden Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/array.lisp,v 1.36 2003/07/15 19:12:27 gerd Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -396,7 +396,8 @@ ...@@ -396,7 +396,8 @@
(declare (fixnum index dim)) (declare (fixnum index dim))
(unless (< -1 index dim) (unless (< -1 index dim)
(if invalid-index-error-p (if invalid-index-error-p
(simple-program-error "Invalid index ~D~[~;~:; on axis ~:*~D~] in ~S" (error 'simple-type-error
"Invalid index ~D~[~;~:; on axis ~:*~D~] in ~S"
index axis array) index axis array)
(return-from %array-row-major-index nil))) (return-from %array-row-major-index nil)))
(incf result (* chunk-size index)) (incf result (* chunk-size index))
...@@ -404,7 +405,8 @@ ...@@ -404,7 +405,8 @@
(let ((index (first subscripts))) (let ((index (first subscripts)))
(unless (< -1 index (length (the (simple-array * (*)) array))) (unless (< -1 index (length (the (simple-array * (*)) array)))
(if invalid-index-error-p (if invalid-index-error-p
(simple-program-error "Invalid index ~D in ~S" index array) (error 'simple-type-error
"Invalid index ~D in ~S" index array)
(return-from %array-row-major-index nil))) (return-from %array-row-major-index nil)))
index)))) index))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment