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? Or at least implement the error handling
24 ;;; functions as closures instead of DEFUNs?
25 (eval-when (:compile-toplevel :execute)
26 (def!macro define-internal-errors (&rest errors)
27 (let ((info (mapcar (lambda (x)
28 (cons (symbolicate (first x) "-ERROR")
32 (setf sb!c:*backend-internal-errors*
33 ',(coerce info 'vector))
36 (define-internal-errors
38 "unknown system lossage")
40 "Object is not of type FUNCTION.")
42 "Object is not of type LIST.")
44 "Object is not of type BIGNUM.")
46 "Object is not of type RATIO.")
47 (object-not-single-float
48 "Object is not of type SINGLE-FLOAT.")
49 (object-not-double-float
50 "Object is not of type DOUBLE-FLOAT.")
52 (object-not-long-float
53 "Object is not of type LONG-FLOAT.")
54 (object-not-simple-string
55 "Object is not of type SIMPLE-STRING.")
57 "Object is not of type FIXNUM.")
59 "Object is not of type VECTOR.")
61 "Object is not of type STRING.")
62 (object-not-base-string
63 "Object is not of type BASE-STRING.")
64 (object-not-vector-nil
65 "Object is not of type (VECTOR NIL).")
67 (object-not-character-string
68 "Object is not of type (VECTOR CHARACTER).")
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.")
92 "invalid argument count")
93 (bogus-arg-to-values-list
94 "bogus argument to VALUES-LIST")
96 "An attempt was made to use an undefined SYMBOL-VALUE.")
98 "Object is not a System Area Pointer (SAP).")
100 "attempt to RETURN-FROM a block that no longer exists")
102 "attempt to THROW to a non-existent tag")
106 "Object is of the wrong type.")
108 "odd number of &KEY arguments")
110 "unknown &KEY argument")
112 "invalid array index")
113 (wrong-number-of-indices
114 "wrong number of indices")
115 (object-not-simple-array
116 "Object is not of type SIMPLE-ARRAY.")
117 (object-not-signed-byte-32
118 "Object is not of type (SIGNED-BYTE 32).")
119 (object-not-unsigned-byte-32
120 "Object is not of type (UNSIGNED-BYTE 32).")
122 "Object is not of type COMPLEX.")
123 (object-not-complex-rational
124 "Object is not of type (COMPLEX RATIONAL).")
125 (object-not-complex-float
126 "Object is not of type (COMPLEX FLOAT).")
127 (object-not-complex-single-float
128 "Object is not of type (COMPLEX SINGLE-FLOAT).")
129 (object-not-complex-double-float
130 "Object is not of type (COMPLEX DOUBLE-FLOAT).")
132 (object-not-complex-long-float
133 "Object is not of type (COMPLEX LONG-FLOAT).")
134 (object-not-weak-pointer
135 "Object is not a WEAK-POINTER.")
137 "Object is not a INSTANCE.")
138 (object-not-character
139 "Object is not a CHARACTER.")
141 "A function with declared result type NIL returned.")
143 "An array with element-type NIL was accessed.")
145 "Object layout is invalid. (indicates obsolete instance)")
146 (object-not-complex-vector
147 "Object is not a complex (non-SIMPLE-ARRAY) vector.")
149 "Thread local storage exhausted.")
154 (symbolicate "OBJECT-NOT-" (sb!vm:saetp-primitive-type-name saetp))
155 (format nil "Object is not of type ~A."
158 `(simple-array ,(sb!vm:saetp-specifier saetp) (*)))))))
159 sb!vm:*specialized-array-element-type-properties*))