X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ffloat-trap.lisp;h=4ba4d1bcb0aed553907d93e684be0571dc94dd42;hb=230707c1899c1c008f7ce2ad97e2fd04849f7443;hp=e0b27307236518f3c17ce7e195e0995321766b7e;hpb=4898ef32c639b1c7f4ee13a5ba566ce6debd03e6;p=sbcl.git diff --git a/src/code/float-trap.lisp b/src/code/float-trap.lisp index e0b2730..4ba4d1b 100644 --- a/src/code/float-trap.lisp +++ b/src/code/float-trap.lisp @@ -161,23 +161,24 @@ (sb!alien:sap-alien context (* os-context-t)))) (traps (logand (ldb float-exceptions-byte modes) (ldb float-traps-byte modes)))) - (cond ((not (zerop (logand float-divide-by-zero-trap-bit traps))) - (error 'division-by-zero)) - ((not (zerop (logand float-invalid-trap-bit traps))) - (error 'floating-point-invalid-operation)) - ((not (zerop (logand float-overflow-trap-bit traps))) - (error 'floating-point-overflow)) - ((not (zerop (logand float-underflow-trap-bit traps))) - (error 'floating-point-underflow)) - ((not (zerop (logand float-inexact-trap-bit traps))) - (error 'floating-point-inexact)) - #!+freebsd - ((zerop (ldb float-exceptions-byte modes)) - ;; I can't tell what caused the exception!! - (error 'floating-point-exception - :traps (getf (get-floating-point-modes) :traps))) - (t - (error 'floating-point-exception))))) + (with-interrupts + (cond ((not (zerop (logand float-divide-by-zero-trap-bit traps))) + (error 'division-by-zero)) + ((not (zerop (logand float-invalid-trap-bit traps))) + (error 'floating-point-invalid-operation)) + ((not (zerop (logand float-overflow-trap-bit traps))) + (error 'floating-point-overflow)) + ((not (zerop (logand float-underflow-trap-bit traps))) + (error 'floating-point-underflow)) + ((not (zerop (logand float-inexact-trap-bit traps))) + (error 'floating-point-inexact)) + #!+freebsd + ((zerop (ldb float-exceptions-byte modes)) + ;; I can't tell what caused the exception!! + (error 'floating-point-exception + :traps (getf (get-floating-point-modes) :traps))) + (t + (error 'floating-point-exception)))))) ;;; Execute BODY with the floating point exceptions listed in TRAPS ;;; masked (disabled). TRAPS should be a list of possible exceptions