mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Pass reference to func, as well as args, when pushing frame. (GH-31100)
This commit is contained in:
parent
2d080347d7
commit
da4d4ec185
5 changed files with 11 additions and 29 deletions
|
@ -109,6 +109,7 @@ _PyFrame_Clear(InterpreterFrame *frame)
|
|||
Py_DECREF(frame->f_code);
|
||||
}
|
||||
|
||||
/* Consumes reference to func */
|
||||
InterpreterFrame *
|
||||
_PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func)
|
||||
{
|
||||
|
@ -117,6 +118,7 @@ _PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func)
|
|||
CALL_STAT_INC(frames_pushed);
|
||||
InterpreterFrame *new_frame = _PyThreadState_BumpFramePointer(tstate, size);
|
||||
if (new_frame == NULL) {
|
||||
Py_DECREF(func);
|
||||
return NULL;
|
||||
}
|
||||
_PyFrame_InitializeSpecials(new_frame, func, NULL, code->co_nlocalsplus);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue