1 ;;;; This file defines all of the internal errors. How they are
2 ;;;; handled is defined in .../code/interr.lisp. How they are signaled
3 ;;;; depends on the machine.
5 ;;;; This software is part of the SBCL system. See the README file for
8 ;;;; This software is derived from the CMU CL system, which was
9 ;;;; written at Carnegie Mellon University and released into the
10 ;;;; public domain. The software is in the public domain and is
11 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
12 ;;;; files for more information.
14 (in-package "SB!KERNEL")
16 (defun error-number-or-lose (name)
17 (or (position name sb!c:*backend-internal-errors* :key #'car)
18 (error "unknown internal error: ~S" name)))
20 ;;; FIXME: Having each of these error handlers be a full, named function
21 ;;; seems to contribute a noticeable amount of bloat and little value.
22 ;;; Perhaps we could just make a single error-handling function with a
23 ;;; big CASE statement inside it?
24 (eval-when (:compile-toplevel :execute)
25 (def!macro define-internal-errors (&rest errors)
26 (let ((info (mapcar #'(lambda (x)
28 (cons (symbolicate (first x) "-ERROR")
33 (setf sb!c:*backend-internal-errors*
34 ',(coerce info 'vector))
37 (define-internal-errors
39 "unknown system lossage")
41 "Object is not of type FUNCTION.")
43 "Object is not of type LIST.")
45 "Object is not of type BIGNUM.")
47 "Object is not of type RATIO.")
48 (object-not-single-float
49 "Object is not of type SINGLE-FLOAT.")
50 (object-not-double-float
51 "Object is not of type DOUBLE-FLOAT.")
53 (object-not-long-float
54 "Object is not of type LONG-FLOAT.")
55 (object-not-simple-string
56 "Object is not of type SIMPLE-STRING.")
57 (object-not-simple-bit-vector
58 "Object is not of type SIMPLE-BIT-VECTOR.")
59 (object-not-simple-vector
60 "Object is not of type SIMPLE-VECTOR.")
62 "Object is not of type FIXNUM.")
63 (object-not-function-or-symbol
64 "Object is not of type FUNCTION or SYMBOL.")
66 "Object is not of type VECTOR.")
68 "Object is not of type STRING.")
69 (object-not-bit-vector
70 "Object is not of type BIT-VECTOR.")
72 "Object is not of type ARRAY.")
74 "Object is not of type NUMBER.")
76 "Object is not of type RATIONAL.")
78 "Object is not of type FLOAT.")
80 "Object is not of type REAL.")
82 "Object is not of type INTEGER.")
84 "Object is not of type CONS.")
86 "Object is not of type SYMBOL.")
88 ;; FIXME: Isn't this used for calls to unbound (SETF FOO) too? If so, revise
90 "An attempt was made to use an undefined FDEFINITION.")
91 (object-not-coerceable-to-function
92 "Object is not coerceable to type FUNCTION.")
93 (invalid-argument-count
94 "invalid argument count")
95 (bogus-argument-to-values-list
96 "bogus argument to VALUES-LIST")
98 "An attempt was made to use an undefined SYMBOL-VALUE.")
99 ;; FIXME: We shouldn't need these placeholder NIL entries any more
100 ;; now that we pass our magic numbers cleanly through sbcl.h.
103 "Object is not a System Area Pointer (SAP).")
105 "attempt to RETURN-FROM a block that no longer exists")
107 "attempt to THROW to a non-existent tag")
111 "Object is of the wrong type.")
113 "odd number of &KEY arguments")
114 (unknown-key-argument
115 "unknown &KEY argument")
119 "invalid array index")
120 (wrong-number-of-indices
121 "wrong number of indices")
122 (object-not-simple-array
123 "Object is not of type SIMPLE-ARRAY.")
124 (object-not-signed-byte-32
125 "Object is not of type (SIGNED-BYTE 32).")
126 (object-not-unsigned-byte-32
127 "Object is not of type (UNSIGNED-BYTE 32).")
128 (object-not-simple-array-unsigned-byte-2
129 "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 2) (*)).")
130 (object-not-simple-array-unsigned-byte-4
131 "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 4) (*)).")
132 (object-not-simple-array-unsigned-byte-8
133 "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*)).")
134 (object-not-simple-array-unsigned-byte-16
135 "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 16) (*)).")
136 (object-not-simple-array-unsigned-byte-32
137 "Object is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 32) (*)).")
138 (object-not-simple-array-signed-byte-8
139 "Object is not of type (SIMPLE-ARRAY (SIGNED-BYTE 8) (*)).")
140 (object-not-simple-array-signed-byte-16
141 "Object is not of type (SIMPLE-ARRAY (SIGNED-BYTE 16) (*)).")
142 (object-not-simple-array-signed-byte-30
143 "Object is not of type (SIMPLE-ARRAY FIXNUM (*)).")
144 (object-not-simple-array-signed-byte-32
145 "Object is not of type (SIMPLE-ARRAY (SIGNED-BYTE 32) (*)).")
146 (object-not-simple-array-single-float
147 "Object is not of type (SIMPLE-ARRAY SINGLE-FLOAT (*)).")
148 (object-not-simple-array-double-float
149 "Object is not of type (SIMPLE-ARRAY DOUBLE-FLOAT (*)).")
151 (object-not-simple-array-long-float
152 "Object is not of type (SIMPLE-ARRAY LONG-FLOAT (*)).")
153 (object-not-simple-array-complex-single-float
154 "Object is not of type (SIMPLE-ARRAY (COMPLEX SINGLE-FLOAT) (*)).")
155 (object-not-simple-array-complex-double-float
156 "Object is not of type (SIMPLE-ARRAY (COMPLEX DOUBLE-FLOAT) (*)).")
158 (object-not-simple-array-complex-long-float
159 "Object is not of type (SIMPLE-ARRAY (COMPLEX LONG-FLOAT) (*)).")
161 "Object is not of type COMPLEX.")
162 (object-not-complex-rational
163 "Object is not of type (COMPLEX RATIONAL).")
164 (object-not-complex-float
165 "Object is not of type (COMPLEX FLOAT).")
166 (object-not-complex-single-float
167 "Object is not of type (COMPLEX SINGLE-FLOAT).")
168 (object-not-complex-double-float
169 "Object is not of type (COMPLEX DOUBLE-FLOAT).")
171 (object-not-complex-long-float
172 "Object is not of type (COMPLEX LONG-FLOAT).")
173 (object-not-weak-pointer
174 "Object is not a WEAK-POINTER.")
176 "Object is not a INSTANCE.")
177 (object-not-base-char
178 "Object is not of type BASE-CHAR.")
179 (nil-function-returned
180 "A function with declared result type NIL returned.")
182 "Object layout is invalid. (indicates obsolete instance)")
183 (object-not-complex-vector
184 "Object is not a complex (non-SIMPLE-ARRAY) vector."))