From 45f7d853604844df0866ec326b06d3430b2d66e8 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Fri, 21 Mar 2014 14:26:45 +0900 Subject: [PATCH] Fixing bug in exception-protect. --- lib/init-7.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/init-7.scm b/lib/init-7.scm index 4fd39f73..fdca37ec 100644 --- a/lib/init-7.scm +++ b/lib/init-7.scm @@ -997,12 +997,12 @@ ;; Similar to unwind-protect, but allows escape via continuations ;; assuming they'll return, whereas exceptions are assumed to not return. (define (with-exception-protect thunk final) - (let ((finalized? #f) - (run-finalize - (lambda () - (cond ((not finalized?) - (set! finalized? #t) - (final)))))) + (let* ((finalized? #f) + (run-finalize + (lambda () + (cond ((not finalized?) + (set! finalized? #t) + (final)))))) (with-exception-handler (lambda (exn) (run-finalize)