Skip to content

Commit

Permalink
Revert "pythonGH-128563: Simplify recursion check in `_PyEval_EvalFra…
Browse files Browse the repository at this point in the history
…meDefault` (pythonGH-129481)"

This reverts commit c3ae5c9.
  • Loading branch information
mpage committed Feb 1, 2025
1 parent cf4c4ec commit 3edc57c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int

_PyInterpreterFrame entry_frame;

if (_Py_EnterRecursiveCallTstate(tstate, "")) {
assert(frame->owner != FRAME_OWNED_BY_INTERPRETER);
_PyEval_FrameClearAndPop(tstate, frame);
return NULL;
}


/* Local "register" variables.
* These are cached values from the frame and code object. */
Expand Down Expand Up @@ -820,6 +816,11 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
tstate->current_frame = frame;

tstate->c_recursion_remaining -= (PY_EVAL_C_STACK_UNITS - 1);
if (_Py_EnterRecursiveCallTstate(tstate, "")) {
tstate->c_recursion_remaining--;
tstate->py_recursion_remaining--;
goto exit_unwind;
}

/* support for generator.throw() */
if (throwflag) {
Expand Down

0 comments on commit 3edc57c

Please sign in to comment.