summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-11-19 18:51:50 (GMT)
committerGitHub <noreply@github.com>2021-11-19 18:51:50 (GMT)
commit4296396db017d782d3aa16100b366748c9ea4a04 (patch)
treea3b5228ac4881bfb74ea10646781bad1b9f15be7 /Python/errors.c
parentc06c7c489a82b2db023bb947f0c4d21ad93b8308 (diff)
downloadcpython-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.c3
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: