Fix leak of floating-point environment in test-arith.scm.
authorTaylor R Campbell <campbell@mumble.net>
Mon, 26 Aug 2019 03:15:43 +0000 (03:15 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Mon, 26 Aug 2019 03:22:44 +0000 (03:22 +0000)
tests/runtime/test-arith.scm

index 14dfad5f581ca419c912b1fef8561029c53c93fb..7c6b9d78d01bec4cf78582b2fff5b747803b3570 100644 (file)
@@ -128,11 +128,13 @@ USA.
 (define (yes-traps f)
   (if (flo:have-trap-enable/disable?)
       ;; XXX Should enable all traps.
-      (begin
-        (flo:clear-exceptions! (flo:supported-exceptions))
-        (flo:with-trapped-exceptions
-            (fix:or (flo:exception:invalid-operation) (flo:exception:overflow))
-          f))
+      (flo:preserving-environment
+       (lambda ()
+        (flo:clear-exceptions! (flo:supported-exceptions))
+        (flo:with-trapped-exceptions
+            (fix:or (flo:exception:invalid-operation)
+                    (flo:exception:overflow))
+          f)))
       (f)))
 
 (define (define-enumerated-test prefix cases procedure)