mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.13] gh-132744: Check recursion limit in _PY_FRAME_GENERAL (GH-132746) (GH-138032)
This commit is contained in:
parent
8f2280272d
commit
ebccd1de88
9 changed files with 164 additions and 122 deletions
14
Python/generated_cases.c.h
generated
14
Python/generated_cases.c.h
generated
|
|
@ -961,6 +961,9 @@
|
|||
PyFunctionObject *func = (PyFunctionObject *)callable;
|
||||
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
||||
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), CALL);
|
||||
}
|
||||
// _CHECK_RECURSION_REMAINING
|
||||
{
|
||||
DEOPT_IF(tstate->py_recursion_remaining <= 1, CALL);
|
||||
}
|
||||
// _INIT_CALL_PY_EXACT_ARGS
|
||||
|
|
@ -1044,6 +1047,10 @@
|
|||
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;
|
||||
|
|
@ -1890,6 +1897,9 @@
|
|||
PyFunctionObject *func = (PyFunctionObject *)callable;
|
||||
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
||||
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), CALL);
|
||||
}
|
||||
// _CHECK_RECURSION_REMAINING
|
||||
{
|
||||
DEOPT_IF(tstate->py_recursion_remaining <= 1, CALL);
|
||||
}
|
||||
// _INIT_CALL_PY_EXACT_ARGS
|
||||
|
|
@ -1955,6 +1965,10 @@
|
|||
PyFunctionObject *func = (PyFunctionObject *)callable;
|
||||
DEOPT_IF(func->func_version != func_version, CALL);
|
||||
}
|
||||
// _CHECK_RECURSION_REMAINING
|
||||
{
|
||||
DEOPT_IF(tstate->py_recursion_remaining <= 1, CALL);
|
||||
}
|
||||
// _PY_FRAME_GENERAL
|
||||
args = &stack_pointer[-oparg];
|
||||
self_or_null = stack_pointer[-1 - oparg];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue