handle floating-point exceptions on windows
parent
bda5963c62
commit
6fa4a6a23b
|
@ -21,24 +21,37 @@ FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe)
|
||||||
else
|
else
|
||||||
signal_callstack_top = NULL;
|
signal_callstack_top = NULL;
|
||||||
|
|
||||||
if(e->ExceptionCode == EXCEPTION_ACCESS_VIOLATION)
|
switch (e->ExceptionCode) {
|
||||||
{
|
case EXCEPTION_ACCESS_VIOLATION:
|
||||||
signal_fault_addr = e->ExceptionInformation[1];
|
signal_fault_addr = e->ExceptionInformation[1];
|
||||||
c->EIP = (cell)memory_signal_handler_impl;
|
c->EIP = (cell)memory_signal_handler_impl;
|
||||||
}
|
break;
|
||||||
|
|
||||||
|
case EXCEPTION_FLT_DENORMAL_OPERAND:
|
||||||
|
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
|
||||||
|
case EXCEPTION_FLT_INEXACT_RESULT:
|
||||||
|
case EXCEPTION_FLT_INVALID_OPERATION:
|
||||||
|
case EXCEPTION_FLT_OVERFLOW:
|
||||||
|
case EXCEPTION_FLT_STACK_CHECK:
|
||||||
|
case EXCEPTION_FLT_UNDERFLOW:
|
||||||
|
c->EIP = (cell)fp_signal_handler_impl;
|
||||||
|
break;
|
||||||
|
|
||||||
/* If the Widcomm bluetooth stack is installed, the BTTray.exe process
|
/* If the Widcomm bluetooth stack is installed, the BTTray.exe process
|
||||||
injects code into running programs. For some reason this results in
|
injects code into running programs. For some reason this results in
|
||||||
random SEH exceptions with this (undocumented) exception code being
|
random SEH exceptions with this (undocumented) exception code being
|
||||||
raised. The workaround seems to be ignoring this altogether, since that
|
raised. The workaround seems to be ignoring this altogether, since that
|
||||||
is what happens if SEH is not enabled. Don't really have any idea what
|
is what happens if SEH is not enabled. Don't really have any idea what
|
||||||
this exception means. */
|
this exception means. */
|
||||||
else if(e->ExceptionCode != 0x40010006)
|
case 0x40010006:
|
||||||
{
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
signal_number = e->ExceptionCode;
|
signal_number = e->ExceptionCode;
|
||||||
c->EIP = (cell)misc_signal_handler_impl;
|
c->EIP = (cell)misc_signal_handler_impl;
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
return EXCEPTION_CONTINUE_EXECUTION;
|
return EXCEPTION_CONTINUE_EXECUTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
void c_to_factor_toplevel(cell quot)
|
void c_to_factor_toplevel(cell quot)
|
||||||
|
|
Loading…
Reference in New Issue