mirror of
https://github.com/python/cpython.git
synced 2025-08-23 02:04:56 +00:00
GH-106057: Handle recursion errors in inline class calls properly. (GH-106108)
This commit is contained in:
parent
e1d45b8ed4
commit
24fb627ea7
4 changed files with 108 additions and 91 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue