From: Stas Boukarev Date: Thu, 29 Aug 2013 23:56:36 +0000 (+0400) Subject: Fix floating point exceptions persisting on Solaris. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e86533e804513080f610795b9d43ca36ad842467;p=sbcl.git Fix floating point exceptions persisting on Solaris. (/ 0d0 0d0) (cosh 90) signaled an invalid-operation exception, and not overflow, on COSH, because the previous error wasn't cleared. Clear the exception flags in the sigfpe handler. --- diff --git a/NEWS b/NEWS index b7268f3..90e9f8b 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ changes relative to sbcl-1.1.11: * bug fix: probe-file now can access symlinks to pipes and sockets in /proc/pid/fd on Linux. (reported by Eric Schulte) * bug fix: SBCL can now be built on Solaris x86-64. + * bug fix: Floating point exceptions do not persist on Solaris anymore. * bug fix: (setf . a) is pprinted correctly (reported by Douglas Katzman). changes in sbcl-1.1.11 relative to sbcl-1.1.10: diff --git a/src/code/float-trap.lisp b/src/code/float-trap.lisp index 6a02139..4bf0429 100644 --- a/src/code/float-trap.lisp +++ b/src/code/float-trap.lisp @@ -195,8 +195,12 @@ sets the floating point modes to their current values (and thus is a no-op)." (declare (type system-area-pointer info)) (let ((code (sb!unix::siginfo-code info))) (with-interrupts - (error (or (cdr (assoc code *sigfpe-code-error-alist*)) - 'floating-point-exception))))) + ;; Reset the accumulated exceptions, may be needed on other + ;; platforms too, at least Linux doesn't seem to require it. + #!+sunos + (setf (ldb sb!vm::float-sticky-bits (floating-point-modes)) 0) + (error (or (cdr (assoc code *sigfpe-code-error-alist*)) + 'floating-point-exception))))) ;;; Execute BODY with the floating point exceptions listed in TRAPS ;;; masked (disabled). TRAPS should be a list of possible exceptions