Perform correct handling of stack overflow for windows: Catch the correct exception code and reset the overflow condition when handled.
This commit is contained in:
parent
d50a5f2845
commit
5299935be5
|
@ -1701,8 +1701,14 @@ PyOS_CheckStack(void)
|
||||||
not enough space left on the stack */
|
not enough space left on the stack */
|
||||||
alloca(PYOS_STACK_MARGIN * sizeof(void*));
|
alloca(PYOS_STACK_MARGIN * sizeof(void*));
|
||||||
return 0;
|
return 0;
|
||||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
} __except (GetExceptionCode() == STATUS_STACK_OVERFLOW ?
|
||||||
/* just ignore all errors */
|
EXCEPTION_EXECUTE_HANDLER :
|
||||||
|
EXCEPTION_CONTINUE_SEARCH) {
|
||||||
|
int errcode = _resetstkoflw();
|
||||||
|
if (errcode)
|
||||||
|
{
|
||||||
|
Py_FatalError("Could not reset the stack!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue