mirror of
https://github.com/python/cpython.git
synced 2026-04-13 23:31:02 +00:00
[3.13] gh-145008: Maintain stack consistency in CALL_BOUND_METHOD_EXACT_ARGS (GH-145015)
This commit is contained in:
parent
702d085783
commit
85f8e76705
4 changed files with 9 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
8
Python/generated_cases.c.h
generated
8
Python/generated_cases.c.h
generated
|
|
@ -1024,6 +1024,10 @@
|
|||
{
|
||||
DEOPT_IF(tstate->interp->eval_frame, CALL);
|
||||
}
|
||||
// _CHECK_RECURSION_REMAINING
|
||||
{
|
||||
DEOPT_IF(tstate->py_recursion_remaining <= 1, CALL);
|
||||
}
|
||||
// _CHECK_METHOD_VERSION
|
||||
null = stack_pointer[-1 - oparg];
|
||||
callable = stack_pointer[-2 - oparg];
|
||||
|
|
@ -1047,10 +1051,6 @@
|
|||
Py_INCREF(method);
|
||||
Py_DECREF(callable);
|
||||
}
|
||||
// _CHECK_RECURSION_REMAINING
|
||||
{
|
||||
DEOPT_IF(tstate->py_recursion_remaining <= 1, CALL);
|
||||
}
|
||||
// _PY_FRAME_GENERAL
|
||||
args = &stack_pointer[-oparg];
|
||||
self_or_null = self;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue