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?) (cond ((not finalized?)
(set! finalized? #t) (set! finalized? #t)
(final)))))) (final))))))
(with-exception-handler (protect (exn (else (run-finalize) (raise exn)))
(lambda (exn)
(run-finalize)
(raise exn))
(lambda ()
(let ((res (thunk))) (let ((res (thunk)))
(run-finalize) (run-finalize)
res))))) res))))
(define-syntax exception-protect (define-syntax exception-protect
(syntax-rules () (syntax-rules ()