mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.9] bpo-43710: Rollback the 3.9 bpo-42500 fix, it broke the ABI in 3.9.3 (#25179)
This reverts commit 8b795ab554
.
It changed the PyThreadState structure size, breaking the ABI in 3.9.3.
This commit is contained in:
parent
de0b2b1330
commit
c7b0feca25
9 changed files with 79 additions and 74 deletions
|
@ -793,22 +793,23 @@ _Py_CheckRecursiveCall(PyThreadState *tstate, const char *where)
|
|||
_Py_CheckRecursionLimit = recursion_limit;
|
||||
}
|
||||
#endif
|
||||
if (tstate->recursion_headroom) {
|
||||
if (tstate->recursion_critical)
|
||||
/* Somebody asked that we don't check for recursion. */
|
||||
return 0;
|
||||
if (tstate->overflowed) {
|
||||
if (tstate->recursion_depth > recursion_limit + 50) {
|
||||
/* Overflowing while handling an overflow. Give up. */
|
||||
Py_FatalError("Cannot recover from stack overflow.");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
if (tstate->recursion_depth > recursion_limit) {
|
||||
tstate->recursion_headroom++;
|
||||
_PyErr_Format(tstate, PyExc_RecursionError,
|
||||
"maximum recursion depth exceeded%s",
|
||||
where);
|
||||
tstate->recursion_headroom--;
|
||||
--tstate->recursion_depth;
|
||||
return -1;
|
||||
}
|
||||
if (tstate->recursion_depth > recursion_limit) {
|
||||
--tstate->recursion_depth;
|
||||
tstate->overflowed = 1;
|
||||
_PyErr_Format(tstate, PyExc_RecursionError,
|
||||
"maximum recursion depth exceeded%s",
|
||||
where);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue