Skip to content

Commit 58c2e83

Browse files
Maintain stack consistency in CALL_BOUND_METHOD_GENERAL
1 parent 6294569 commit 58c2e83

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Include/internal/pycore_opcode_metadata.h

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

Python/bytecodes.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3241,9 +3241,11 @@ dummy_func(
32413241
macro(CALL_BOUND_METHOD_GENERAL) =
32423242
unused/1 + // Skip over the counter
32433243
_CHECK_PEP_523 +
3244+
// gh-145008: We must check recursion before expanding method,
3245+
// otherwise we may leave the stack in an inconsistent state in 3.13.
3246+
_CHECK_RECURSION_REMAINING +
32443247
_CHECK_METHOD_VERSION +
32453248
_EXPAND_METHOD +
3246-
_CHECK_RECURSION_REMAINING +
32473249
_PY_FRAME_GENERAL +
32483250
_SAVE_RETURN_OFFSET +
32493251
_PUSH_FRAME;

Python/generated_cases.c.h

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

0 commit comments

Comments
 (0)