diff options
author | Ken Jin <kenjin@python.org> | 2025-05-02 16:36:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-02 16:36:29 (GMT) |
commit | ddac7ac59a7dfa4437562b6e705e64865c3b1e9a (patch) | |
tree | 20f83f6e1b605071f80346659124a99cd04d2d79 /Python/generated_cases.c.h | |
parent | 987e45e6326c6174fb7a300f44b9d8e4e26370c9 (diff) | |
download | cpython-ddac7ac59a7dfa4437562b6e705e64865c3b1e9a.zip cpython-ddac7ac59a7dfa4437562b6e705e64865c3b1e9a.tar.gz cpython-ddac7ac59a7dfa4437562b6e705e64865c3b1e9a.tar.bz2 |
gh-132744: Check recursion limit in CALL_PY_GENERAL (GH-132746)
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r-- | Python/generated_cases.c.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 004f4db..08b72a0 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -1907,6 +1907,9 @@ assert(_PyOpcode_Deopt[opcode] == (CALL)); JUMP_TO_PREDICTED(CALL); } + } + // _CHECK_RECURSION_REMAINING + { if (tstate->py_recursion_remaining <= 1) { UPDATE_MISS_STATS(CALL); assert(_PyOpcode_Deopt[opcode] == (CALL)); @@ -2022,6 +2025,14 @@ stack_pointer = _PyFrame_GetStackPointer(frame); } // flush + // _CHECK_RECURSION_REMAINING + { + if (tstate->py_recursion_remaining <= 1) { + UPDATE_MISS_STATS(CALL); + assert(_PyOpcode_Deopt[opcode] == (CALL)); + JUMP_TO_PREDICTED(CALL); + } + } // _PY_FRAME_GENERAL { args = &stack_pointer[-oparg]; @@ -4168,6 +4179,9 @@ assert(_PyOpcode_Deopt[opcode] == (CALL)); JUMP_TO_PREDICTED(CALL); } + } + // _CHECK_RECURSION_REMAINING + { if (tstate->py_recursion_remaining <= 1) { UPDATE_MISS_STATS(CALL); assert(_PyOpcode_Deopt[opcode] == (CALL)); @@ -4254,6 +4268,14 @@ JUMP_TO_PREDICTED(CALL); } } + // _CHECK_RECURSION_REMAINING + { + if (tstate->py_recursion_remaining <= 1) { + UPDATE_MISS_STATS(CALL); + assert(_PyOpcode_Deopt[opcode] == (CALL)); + JUMP_TO_PREDICTED(CALL); + } + } // _PY_FRAME_GENERAL { args = &stack_pointer[-oparg]; |