summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-07-07 10:09:26 (GMT)
committerGitHub <noreply@github.com>2023-07-07 10:09:26 (GMT)
commit24fb627ea7a4d57cf479b7516bafdb6c253a1645 (patch)
tree370012371f9b7cd2998691324f3b141cf49d0446 /Python/bytecodes.c
parente1d45b8ed43e1590862319fec33539f8adbc0849 (diff)
downloadcpython-24fb627ea7a4d57cf479b7516bafdb6c253a1645.zip
cpython-24fb627ea7a4d57cf479b7516bafdb6c253a1645.tar.gz
cpython-24fb627ea7a4d57cf479b7516bafdb6c253a1645.tar.bz2
GH-106057: Handle recursion errors in inline class calls properly. (GH-106108)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 70b5239..89b077a 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -2985,9 +2985,6 @@ dummy_func(
goto error;
}
Py_DECREF(tp);
- if (_Py_EnterRecursivePy(tstate)) {
- goto exit_unwind;
- }
_PyInterpreterFrame *shim = _PyFrame_PushTrampolineUnchecked(
tstate, (PyCodeObject *)&_Py_InitCleanup, 1, 0);
assert(_PyCode_CODE((PyCodeObject *)shim->f_executable)[1].op.code == EXIT_INIT_CHECK);
@@ -3011,6 +3008,10 @@ dummy_func(
shim->previous = frame;
frame = cframe.current_frame = init_frame;
CALL_STAT_INC(inlined_py_calls);
+ /* Account for pushing the extra frame.
+ * We don't check recursion depth here,
+ * as it will be checked after start_frame */
+ tstate->py_recursion_remaining--;
goto start_frame;
}