From: Kristján Valur Jónsson Date: Mon, 18 Feb 2008 17:40:47 +0000 (+0000) Subject: Perform correct handling of stack overflow for windows: Catch the correct exception... X-Git-Tag: v2.6a1~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5299935be5acefae819bcc08a888a9466747d7cb;p=python Perform correct handling of stack overflow for windows: Catch the correct exception code and reset the overflow condition when handled. --- diff --git a/Python/pythonrun.c b/Python/pythonrun.c index ec31af10c9..298d21862f 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1701,8 +1701,14 @@ PyOS_CheckStack(void) not enough space left on the stack */ alloca(PYOS_STACK_MARGIN * sizeof(void*)); return 0; - } __except (EXCEPTION_EXECUTE_HANDLER) { - /* just ignore all errors */ + } __except (GetExceptionCode() == STATUS_STACK_OVERFLOW ? + EXCEPTION_EXECUTE_HANDLER : + EXCEPTION_CONTINUE_SEARCH) { + int errcode = _resetstkoflw(); + if (errcode) + { + Py_FatalError("Could not reset the stack!"); + } } return 1; }