From 519d513377255796b21230c2d51df6dcc51e3f67 Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Thu, 24 Dec 2015 22:47:24 -0800
Subject: [PATCH] (setf floating-point-modes) wants (unsigned-byte 24)

When enabling traps, need to take just the low 24 bits of the arg
because (setf floating-point-modes) wants an (unsigned-byte 24)
argument.  The logorc2 makes the result negative when enabling traps.
---
 src/code/float-trap.lisp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/code/float-trap.lisp b/src/code/float-trap.lisp
index 0d9fd3405..4cdf63651 100644
--- a/src/code/float-trap.lisp
+++ b/src/code/float-trap.lisp
@@ -397,7 +397,8 @@
 		   (unwind-protect
 			(progn
 			  (setf (floating-point-modes)
-				(,',logical-op ,orig-modes ,(logand trap-mask exception-mask)))
+				(ldb (byte 24 0)
+				     (,',logical-op ,orig-modes ,(logand trap-mask exception-mask))))
 			  ,@body)
 		     ;; Restore the original traps and exceptions.
 		     (setf (floating-point-modes)
-- 
GitLab