Skip to content

Commit cf8e2c0

Browse files
committed
Call _Py_EnterRecursivePy in _FRAME_PUSH
1 parent 94630d4 commit cf8e2c0

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

Python/bytecodes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,6 +2994,7 @@ dummy_func(
29942994
#endif
29952995
#if TIER_TWO
29962996
frame = tstate->cframe->current_frame = new_frame;
2997+
ERROR_IF(_Py_EnterRecursivePy(tstate), xz);
29972998
stack_pointer = _PyFrame_GetStackPointer(frame);
29982999
ip_offset = (_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive;
29993000
#endif

Python/ceval.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,6 @@ int _Py_CheckRecursiveCallPy(
602602
return 0;
603603
}
604604

605-
static inline int _Py_EnterRecursivePy(PyThreadState *tstate) {
606-
return (tstate->py_recursion_remaining-- <= 0) &&
607-
_Py_CheckRecursiveCallPy(tstate);
608-
}
609-
610605

611606
static inline void _Py_LeaveRecursiveCallPy(PyThreadState *tstate) {
612607
tstate->py_recursion_remaining++;

Python/ceval_macros.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,8 @@ static const convertion_func_ptr CONVERSION_FUNCTIONS[4] = {
369369
#else
370370
#define _Py_atomic_load_relaxed_int32(ATOMIC_VAL) _Py_atomic_load_relaxed(ATOMIC_VAL)
371371
#endif
372+
373+
static inline int _Py_EnterRecursivePy(PyThreadState *tstate) {
374+
return (tstate->py_recursion_remaining-- <= 0) &&
375+
_Py_CheckRecursiveCallPy(tstate);
376+
}

Python/executor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject
115115
pop_2_error:
116116
STACK_SHRINK(1);
117117
pop_1_error:
118+
pop_1_exit_unwind:
118119
STACK_SHRINK(1);
119120
error:
120121
// On ERROR_IF we return NULL as the frame.

Python/executor_cases.c.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)