Exception handling for SIGFPE must always clear the FPU interrupt

status.
This commit is contained in:
Dave Hawkes 2000-06-23 16:49:09 +00:00 committed by Alexandre Julliard
parent 4f356e86e4
commit 52b6bd95d3
1 changed files with 2 additions and 1 deletions

View File

@ -443,6 +443,8 @@ static void inline save_fpu( CONTEXT *context, const SIGCONTEXT *sigcontext )
*/
static void inline restore_fpu( CONTEXT *context, const SIGCONTEXT *sigcontext )
{
/* reset the current interrupt status */
context->FloatSave.StatusWord &= context->FloatSave.ControlWord | 0xffffff80;
#ifdef FPU_sig
if (FPU_sig(sigcontext))
{
@ -452,7 +454,6 @@ static void inline restore_fpu( CONTEXT *context, const SIGCONTEXT *sigcontext )
#endif /* FPU_sig */
#ifdef __GNUC__
/* avoid nested exceptions */
context->FloatSave.StatusWord &= context->FloatSave.ControlWord | 0xffffff80;
__asm__ __volatile__( "frstor %0; fwait" : : "m" (context->FloatSave) );
#endif /* __GNUC__ */
}