mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-44525: Add recursive checks for CALL_FUNCTION_BUILTIN_O
(GH-29271)
This commit is contained in:
parent
f291404a80
commit
0a1a36b74b
1 changed files with 6 additions and 0 deletions
|
@ -4742,8 +4742,14 @@ check_eval_breaker:
|
|||
STAT_INC(CALL_FUNCTION, hit);
|
||||
|
||||
PyCFunction cfunc = PyCFunction_GET_FUNCTION(callable);
|
||||
// This is slower but CPython promises to check all non-vectorcall
|
||||
// function calls.
|
||||
if (_Py_EnterRecursiveCall(tstate, " while calling a Python object")) {
|
||||
goto error;
|
||||
}
|
||||
PyObject *arg = POP();
|
||||
PyObject *res = cfunc(PyCFunction_GET_SELF(callable), arg);
|
||||
_Py_LeaveRecursiveCall(tstate);
|
||||
assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
|
||||
|
||||
/* Clear the stack of the function object. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue