From 99f7f3288b62f1eb9f1032bd31e0e9517055dbaf Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Fri, 21 Mar 2014 14:33:11 +0900 Subject: [PATCH] Handling reraise properly in exception-protect. --- lib/init-7.scm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/init-7.scm b/lib/init-7.scm index fdca37ec..aba6d5c2 100644 --- a/lib/init-7.scm +++ b/lib/init-7.scm @@ -1003,14 +1003,10 @@ (cond ((not finalized?) (set! finalized? #t) (final)))))) - (with-exception-handler - (lambda (exn) - (run-finalize) - (raise exn)) - (lambda () - (let ((res (thunk))) - (run-finalize) - res))))) + (protect (exn (else (run-finalize) (raise exn))) + (let ((res (thunk))) + (run-finalize) + res)))) (define-syntax exception-protect (syntax-rules ()