From: Taylor R Campbell Date: Tue, 3 Sep 2019 13:37:25 +0000 (+0000) Subject: Mark floenv in use so exceptions stay cleared if preempted. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~54 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=cb5cf4cd56029fe987108ce7d22493840957b143;p=mit-scheme.git Mark floenv in use so exceptions stay cleared if preempted. Otherwise, we might do: T1: clear-float-exceptions preempt and switch T2: floating-point operation that raises exceptions preempt and switch T1: use-floating-point-environment! and the exceptions may remain raised from T2. --- diff --git a/src/runtime/floenv.scm b/src/runtime/floenv.scm index 149e815da..819c9bfc6 100644 --- a/src/runtime/floenv.scm +++ b/src/runtime/floenv.scm @@ -247,15 +247,15 @@ USA. (define (flo:set-trapped-exceptions! exceptions) (if (not (using-floating-point-environment?)) (begin - ((ucode-primitive clear-float-exceptions 1) exceptions) - (use-floating-point-environment!))) + (use-floating-point-environment!) + ((ucode-primitive clear-float-exceptions 1) exceptions))) ((ucode-primitive set-trapped-float-exceptions 1) exceptions)) (define (flo:trap-exceptions! exceptions) (if (not (using-floating-point-environment?)) (begin - ((ucode-primitive clear-float-exceptions 1) exceptions) - (use-floating-point-environment!))) + (use-floating-point-environment!) + ((ucode-primitive clear-float-exceptions 1) exceptions))) ((ucode-primitive trap-float-exceptions 1) exceptions)) (define (flo:untrap-exceptions! exceptions)