X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ffloat-trap.lisp;h=2a772a5eb0e5f20c3907910c7cfe43b21bbfb024;hb=aa61c7571b33b86981301f34d3acdb66666f53a3;hp=caadeafd4262e3ecaa587e84a94994ea79d19ce6;hpb=c8af15e61b030c8d4b0e950bc9b7618530044618;p=sbcl.git diff --git a/src/code/float-trap.lisp b/src/code/float-trap.lisp index caadeaf..2a772a5 100644 --- a/src/code/float-trap.lisp +++ b/src/code/float-trap.lisp @@ -127,11 +127,11 @@ ;;; Signal the appropriate condition when we get a floating-point error. (defun sigfpe-handler (signal info context) - (declare (ignore signal info)) + (declare (ignore signal info context)) (declare (type system-area-pointer context)) ;; FIXME: The find-the-detailed-problem code below went stale with ;; the big switchover to POSIX signal handling and signal contexts - ;; which are opaque at the Lisp level ca plod-0.6.7. It needs to be + ;; which are opaque at the Lisp level ca. sbcl-0.6.7. It needs to be ;; revived, which will require writing a C-level os-dependent ;; function to extract floating point modes, and a Lisp-level ;; DEF-ALIEN-ROUTINE to get to the C-level os-dependent function. @@ -173,16 +173,17 @@ (exceptions (dpb (float-trap-mask traps) float-sticky-bits 0)) (trap-mask (dpb (lognot (float-trap-mask traps)) float-traps-byte #xffffffff)) - (exception-mask (dpb (lognot (sb!vm::float-trap-mask traps)) - float-sticky-bits #xffffffff))) - `(let ((orig-modes (floating-point-modes))) + (exception-mask (dpb (lognot (float-trap-mask traps)) + float-sticky-bits #xffffffff)) + (orig-modes (gensym))) + `(let ((,orig-modes (floating-point-modes))) (unwind-protect (progn (setf (floating-point-modes) - (logand orig-modes ,(logand trap-mask exception-mask))) + (logand ,orig-modes ,(logand trap-mask exception-mask))) ,@body) ;; Restore the original traps and exceptions. (setf (floating-point-modes) - (logior (logand orig-modes ,(logior traps exceptions)) + (logior (logand ,orig-modes ,(logior traps exceptions)) (logand (floating-point-modes) ,(logand trap-mask exception-mask))))))))