diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2008-02-18 17:40:47 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2008-02-18 17:40:47 (GMT) |
commit | 5299935be5acefae819bcc08a888a9466747d7cb (patch) | |
tree | f7a5fabe2363bbe7baf86cadcee88e173c9c935e /Python/pythonrun.c | |
parent | d50a5f28450a6da6bf38a71b512761578e7556d8 (diff) | |
download | cpython-5299935be5acefae819bcc08a888a9466747d7cb.zip cpython-5299935be5acefae819bcc08a888a9466747d7cb.tar.gz cpython-5299935be5acefae819bcc08a888a9466747d7cb.tar.bz2 |
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.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index ec31af1..298d218 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; } |