From d526f15c426172731f81ec522bcd15d23e9af3b4 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Mon, 26 Aug 2019 03:15:43 +0000 Subject: [PATCH] Fix leak of floating-point environment in test-arith.scm. --- tests/runtime/test-arith.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/runtime/test-arith.scm b/tests/runtime/test-arith.scm index 14dfad5f5..7c6b9d78d 100644 --- a/tests/runtime/test-arith.scm +++ b/tests/runtime/test-arith.scm @@ -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) -- 2.25.1