From 5385aa8217d5108878f5db04af6afbc71da948f3 Mon Sep 17 00:00:00 2001
From: dtc <dtc>
Date: Sat, 21 Oct 2000 12:42:46 +0000
Subject: [PATCH] Take more care when restoring the FPU control word for linux,
 as there may not be a fpstate in some rare cases.

---
 lisp/interrupt.c | 5 +++--
 lisp/x86-arch.c  | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/interrupt.c b/lisp/interrupt.c
index 0194308f5..2c484f08f 100644
--- a/lisp/interrupt.c
+++ b/lisp/interrupt.c
@@ -1,4 +1,4 @@
-/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.c,v 1.22 2000/04/12 17:31:19 pw Exp $ */
+/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.c,v 1.23 2000/10/21 12:42:46 dtc Exp $ */
 
 /* Interrupt handing magic. */
 
@@ -271,7 +271,8 @@ interrupt_handle_now(HANDLER_ARGS)
      * Restore the FPU control word, setting the rounding mode to nearest.
      */
 
-    setfpucw(contextstruct.fpstate->cw & ~0xc00);
+    if (contextstruct.fpstate)
+      setfpucw(contextstruct.fpstate->cw & ~0xc00);
 #endif
 
     handler = interrupt_handlers[signal];
diff --git a/lisp/x86-arch.c b/lisp/x86-arch.c
index e19f4fbe0..97258867a 100644
--- a/lisp/x86-arch.c
+++ b/lisp/x86-arch.c
@@ -1,6 +1,6 @@
 /* x86-arch.c -*- Mode: C; comment-column: 40 -*-
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-arch.c,v 1.12 2000/09/05 08:51:52 dtc Exp $ 
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-arch.c,v 1.13 2000/10/21 12:42:46 dtc Exp $ 
  *
  */
 
@@ -215,7 +215,8 @@ void  sigtrap_handler(HANDLER_ARGS)
    * Restore the FPU control word, setting the rounding mode to nearest.
    */
 
-  setfpucw(contextstruct.fpstate->cw & ~0xc00);
+  if (contextstruct.fpstate)
+    setfpucw(contextstruct.fpstate->cw & ~0xc00);
 #endif
 
  /*
-- 
GitLab