diff options
author | Mark Shannon <mark@hotpy.org> | 2021-11-19 18:51:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-19 18:51:50 (GMT) |
commit | 4296396db017d782d3aa16100b366748c9ea4a04 (patch) | |
tree | a3b5228ac4881bfb74ea10646781bad1b9f15be7 /Python/errors.c | |
parent | c06c7c489a82b2db023bb947f0c4d21ad93b8308 (diff) | |
download | cpython-4296396db017d782d3aa16100b366748c9ea4a04.zip cpython-4296396db017d782d3aa16100b366748c9ea4a04.tar.gz cpython-4296396db017d782d3aa16100b366748c9ea4a04.tar.bz2 |
[3.9] bpo-45806: Fix recovery from stack overflow for 3.9. Again. (GH-29640)
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/errors.c b/Python/errors.c index 40d8e68..7927876 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -317,12 +317,14 @@ _PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, PyObject **val, PyObject **tb) { int recursion_depth = 0; + tstate->overflowed++; PyObject *type, *value, *initial_tb; restart: type = *exc; if (type == NULL) { /* There was no exception, so nothing to do. */ + tstate->overflowed--; return; } @@ -374,6 +376,7 @@ _PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc, } *exc = type; *val = value; + tstate->overflowed--; return; error: |