Handling reraise properly in exception-protect.

This commit is contained in:
Alex Shinn 2014-03-21 14:33:11 +09:00
parent 45f7d85360
commit 99f7f3288b

View file

@ -1003,14 +1003,10 @@
(cond ((not finalized?)
(set! finalized? #t)
(final))))))
(with-exception-handler
(lambda (exn)
(run-finalize)
(raise exn))
(lambda ()
(protect (exn (else (run-finalize) (raise exn)))
(let ((res (thunk)))
(run-finalize)
res)))))
res))))
(define-syntax exception-protect
(syntax-rules ()