[3.13] gh-145008: Maintain stack consistency in CALL_BOUND_METHOD_EXACT_ARGS (GH-145015)

This commit is contained in:
Ken Jin 2026-03-03 04:09:02 +08:00 committed by GitHub
parent 702d085783
commit 85f8e76705
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 6 deletions

View file

@ -3241,9 +3241,11 @@ dummy_func(
macro(CALL_BOUND_METHOD_GENERAL) =
unused/1 + // Skip over the counter
_CHECK_PEP_523 +
// gh-145008: We must check recursion before expanding method,
// otherwise we may leave the stack in an inconsistent state in 3.13.
_CHECK_RECURSION_REMAINING +
_CHECK_METHOD_VERSION +
_EXPAND_METHOD +
_CHECK_RECURSION_REMAINING +
_PY_FRAME_GENERAL +
_SAVE_RETURN_OFFSET +
_PUSH_FRAME;