X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefboot.lisp;h=13d06188efcfa8b792fb9e500406190a352e7852;hb=55dc8558f0686a9d1c8e7f8025bfe373b0c35e33;hp=2ad6f6f139c576de081d195c59add6e1d16527bb;hpb=b1f7d9dcedbd900c3c4d6c171a92f4ae7e075166;p=sbcl.git diff --git a/src/code/defboot.lisp b/src/code/defboot.lisp index 2ad6f6f..13d0618 100644 --- a/src/code/defboot.lisp +++ b/src/code/defboot.lisp @@ -617,9 +617,7 @@ evaluated as a PROGN." (cons (list ,@(mapcar (lambda (x) `(cons ',(car x) ,(cadr x))) mapped-bindings)) *handler-clusters*))) - ;; KLUDGE: Only on platforms with DX FIXED-ALLOC. FIXME: Add a - ;; feature for that, so we can conditionalize on it neatly. - #!+(or hppa mips x86 x86-64) + #!+stack-allocatable-fixed-objects (declare (truly-dynamic-extent *handler-clusters*)) (progn ,form))))) @@ -662,7 +660,7 @@ specification." (push `(,fun ,ll ,@body) local-funs) (list tag type ll fun)))) cases))) - (with-unique-names (block var form-fun) + (with-unique-names (block cell form-fun) `(dx-flet ((,form-fun () #!-x86 ,form ;; Need to catch FP errors here! @@ -670,8 +668,14 @@ specification." ,@(reverse local-funs)) (declare (optimize (sb!c::check-tag-existence 0))) (block ,block - (dx-let ((,var nil)) - (declare (ignorable ,var)) + ;; KLUDGE: We use a dx CONS cell instead of just assigning to + ;; the variable directly, so that we can stack allocate + ;; robustly: dx value cells don't work quite right, and it is + ;; possible to construct user code that should loop + ;; indefinitely, but instead eats up some stack each time + ;; around. + (dx-let ((,cell (cons :condition nil))) + (declare (ignorable ,cell)) (tagbody (%handler-bind ,(mapcar (lambda (annotated-case) @@ -680,7 +684,7 @@ specification." (list type `(lambda (temp) ,(if ll - `(setf ,var temp) + `(setf (cdr ,cell) temp) '(declare (ignore temp))) (go ,tag))))) annotated-cases) @@ -692,7 +696,7 @@ specification." (list tag `(return-from ,block ,(if ll - `(,fun-name ,var) + `(,fun-name (cdr ,cell)) `(,fun-name)))))) annotated-cases))))))))))