mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
gh-132744: Check recursion limit in CALL_PY_GENERAL (GH-132746)
This commit is contained in:
parent
987e45e632
commit
ddac7ac59a
9 changed files with 220 additions and 170 deletions
|
@ -3858,6 +3858,7 @@ dummy_func(
|
|||
unused/1 + // Skip over the counter
|
||||
_CHECK_PEP_523 +
|
||||
_CHECK_FUNCTION_VERSION +
|
||||
_CHECK_RECURSION_REMAINING +
|
||||
_PY_FRAME_GENERAL +
|
||||
_SAVE_RETURN_OFFSET +
|
||||
_PUSH_FRAME;
|
||||
|
@ -3889,6 +3890,7 @@ dummy_func(
|
|||
_CHECK_METHOD_VERSION +
|
||||
_EXPAND_METHOD +
|
||||
flush + // so that self is in the argument array
|
||||
_CHECK_RECURSION_REMAINING +
|
||||
_PY_FRAME_GENERAL +
|
||||
_SAVE_RETURN_OFFSET +
|
||||
_PUSH_FRAME;
|
||||
|
@ -3967,6 +3969,9 @@ dummy_func(
|
|||
PyFunctionObject *func = (PyFunctionObject *)callable_o;
|
||||
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
||||
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize));
|
||||
}
|
||||
|
||||
op(_CHECK_RECURSION_REMAINING, (--)) {
|
||||
DEOPT_IF(tstate->py_recursion_remaining <= 1);
|
||||
}
|
||||
|
||||
|
@ -4008,6 +4013,7 @@ dummy_func(
|
|||
_CHECK_FUNCTION_VERSION +
|
||||
_CHECK_FUNCTION_EXACT_ARGS +
|
||||
_CHECK_STACK_SPACE +
|
||||
_CHECK_RECURSION_REMAINING +
|
||||
_INIT_CALL_PY_EXACT_ARGS +
|
||||
_SAVE_RETURN_OFFSET +
|
||||
_PUSH_FRAME;
|
||||
|
@ -4018,6 +4024,7 @@ dummy_func(
|
|||
_CHECK_FUNCTION_VERSION +
|
||||
_CHECK_FUNCTION_EXACT_ARGS +
|
||||
_CHECK_STACK_SPACE +
|
||||
_CHECK_RECURSION_REMAINING +
|
||||
_INIT_CALL_PY_EXACT_ARGS +
|
||||
_SAVE_RETURN_OFFSET +
|
||||
_PUSH_FRAME;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue