Clear exceptions before enabling traps.
authorTaylor R Campbell <campbell@mumble.net>
Fri, 14 Dec 2018 15:43:07 +0000 (15:43 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sat, 15 Dec 2018 22:33:21 +0000 (22:33 +0000)
tests/runtime/test-arith.scm
tests/runtime/test-flonum.scm

index f8a5cb6c9b0cdbd66ea8470592dfe58f50b6c9ba..a018bdd7a4c77b51213bd9cb562df7e1b60f8d83 100644 (file)
@@ -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)
index e68e57ce1ab41b39908721352853afa761d2d71c..87fbf0e1cfb6b39fb9ded0ef2fe049296051db88 100644 (file)
@@ -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)