summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2008-02-18 17:40:47 +0000
committerKristján Valur Jónsson <kristjan@ccpgames.com>2008-02-18 17:40:47 +0000
commit217e4f8044ba5a28879c48461466b3c7d46dd4da (patch)
tree6bfeb97ed9cca9e8d84c68d532c7ac488be8fef5 /Python/pythonrun.c
parentfd8f3d4b7cb0878eb20c469019a05399a589202b (diff)
downloadcpython-217e4f8044ba5a28879c48461466b3c7d46dd4da.tar.gz
Perform correct handling of stack overflow for windows: Catch the correct exception code and reset the overflow condition when handled.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c10
1 files changed, 8 insertions, 2 deletions
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;
}