Skip to content
Snippets Groups Projects
Commit d8fe9deb authored by dtc's avatar dtc
Browse files

Revise the error format of invalid-array-index-error-handler to better

handle zero length arrays and negative indexes; suggested by Raymond Toy.
parent 92b69d53
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/interr.lisp,v 1.36 1998/12/19 16:05:46 dtc Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/interr.lisp,v 1.37 1999/05/01 04:32:45 dtc Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -316,7 +316,12 @@
(error 'simple-error
:function-name name
:format-control
"Invalid array index, ~D for ~S. Should have been less than ~D"
(cond ((zerop bound)
"Invalid array index, ~D for ~S. Array has no elements.")
((minusp index)
"Invalid array index, ~D for ~S. Should have greater than or equal to 0.")
(t
"Invalid array index, ~D for ~S. Should have been less than ~D"))
:format-arguments (list index array bound)))
(deferr object-not-simple-array-error (object)
......
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