Bug 538056 - Signal handler for FPU exception is broken for Windows x64, r=m_kato,bsmedberg
authorMook <mook.moz+hg%gmail.com>
Tue, 29 Dec 2009 01:48:02 -0800
changeset 37290 badc9da7c09c12361ae6cfbeca95b02687e31cf3
parent 37289 2efbd11163b395bf5adc0cc59664463873e4449e
child 37291 e1ac16b86b80be9ed34632cedd9bef10eece29d4
push id11212
push userphilringnalda@gmail.com
push dateMon, 18 Jan 2010 20:20:33 +0000
treeherdermozilla-central@badc9da7c09c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato, bsmedberg
bugs538056
milestone1.9.3a1pre
Bug 538056 - Signal handler for FPU exception is broken for Windows x64, r=m_kato,bsmedberg toolkit/xre/nsSigHandlers.h: define x86 constants also for msvc x86-64 toolkit/xre/nsSigHandlers.cpp: Take into account different structure names for win64
toolkit/xre/nsSigHandlers.cpp
toolkit/xre/nsSigHandlers.h
--- a/toolkit/xre/nsSigHandlers.cpp
+++ b/toolkit/xre/nsSigHandlers.cpp
@@ -394,18 +394,23 @@ void InstallSignalHandlers(const char *P
 #endif
 
 #ifdef _M_X64
 #define MXCSR(ctx) (ctx)->MxCsr
 #endif
 
 #if defined(_M_IX86) || defined(_M_X64)
 
+#ifdef _M_X64
+#define X87CW(ctx) (ctx)->FltSave.ControlWord
+#define X87SW(ctx) (ctx)->FltSave.StatusWord
+#else
 #define X87CW(ctx) (ctx)->FloatSave.ControlWord
 #define X87SW(ctx) (ctx)->FloatSave.StatusWord
+#endif
 
 /*
  * SSE traps raise these exception codes, which are defined in internal NT headers
  * but not winbase.h
  */
 #define STATUS_FLOAT_MULTIPLE_FAULTS 0xC00002B4
 #define STATUS_FLOAT_MULTIPLE_TRAPS  0xC00002B5
 
--- a/toolkit/xre/nsSigHandlers.h
+++ b/toolkit/xre/nsSigHandlers.h
@@ -31,17 +31,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(__amd64__)
+#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__amd64__)
 
 /*
  * x87 FPU Control Word:
  *
  * 0 -> IM  Invalid Operation
  * 1 -> DM  Denormalized Operand
  * 2 -> ZM  Zero Divide
  * 3 -> OM  Overflow