Browse files

Use make-exception instead of make-instance; Work around CMUCL bug

  • Loading branch information...
metawilm committed Feb 10, 2011
1 parent 679a052 commit b1393f6670259bb5aef8d0621327fa27c76dcea0
Showing with 5 additions and 2 deletions.
  1. +2 −2 compiler/compiler.lisp
  2. +3 −0 runtime/exceptions.lisp
@@ -1649,12 +1649,12 @@ LOCALS shares share tail structure with input arg locals."
((and exc var)
(etypecase exc
- (class (error (make-instance exc :args (list var))))
+ (class (error (make-exception exc var)))
(error (progn (warn "RAISE: ignored arg, as exc was already an instance, not a class")
(error exc)))))
(etypecase exc
- (class (error (make-instance exc)))
+ (class (error (make-exception exc)))
(error (error exc))))
@@ -68,6 +68,9 @@
(format stream ": ~@<~@;~A~:>" (if format-args (apply #'format nil string format-args) string)))))
(defun make-exception (class-name &rest args)
+ #+cmu ;; Work around bug that :args initarg is not accepted by make-condition if first arg is a class object
+ (when (typep class-name 'class)
+ (setf class-name (class-name class-name)))
(#+clpython-exceptions-are-python-objects make-instance
#-clpython-exceptions-are-python-objects make-condition
class-name :args args))

0 comments on commit b1393f6

Please sign in to comment.