From ed33c12c038c1389b3be47e87c169f8e13875876 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 14 Dec 2018 15:43:07 +0000 Subject: [PATCH] Clear exceptions before enabling traps. --- tests/runtime/test-arith.scm | 8 +++++--- tests/runtime/test-flonum.scm | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/runtime/test-arith.scm b/tests/runtime/test-arith.scm index f8a5cb6c9..a018bdd7a 100644 --- a/tests/runtime/test-arith.scm +++ b/tests/runtime/test-arith.scm @@ -123,9 +123,11 @@ USA. (define (yes-traps f) (if (flo:have-trap-enable/disable?) ;; XXX Should enable all traps. - (flo:with-trapped-exceptions - (fix:or (flo:exception:invalid-operation) (flo:exception:overflow)) - f) + (begin + (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) diff --git a/tests/runtime/test-flonum.scm b/tests/runtime/test-flonum.scm index e68e57ce1..87fbf0e1c 100644 --- a/tests/runtime/test-flonum.scm +++ b/tests/runtime/test-flonum.scm @@ -117,7 +117,11 @@ USA. (define (yes-traps f) (if (flo:have-trap-enable/disable?) ;; XXX Should enable all traps. - (flo:with-trapped-exceptions (flo:exception:invalid-operation) f) + (begin + (flo:clear-exceptions! (flo:supported-exceptions)) + (flo:with-trapped-exceptions + (fix:or (flo:exception:invalid-operation) (flo:exception:overflow)) + f)) (f))) (define subnormal+ flo:smallest-positive-subnormal) -- 2.25.1