mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +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
|
@ -2212,26 +2212,6 @@ _PyThreadState_BumpFramePointerSlow(PyThreadState *tstate, size_t size)
|
|||
return (InterpreterFrame *)base;
|
||||
}
|
||||
|
||||
|
||||
InterpreterFrame *
|
||||
_PyThreadState_PushFrame(PyThreadState *tstate, PyFunctionObject *func, PyObject *locals)
|
||||
{
|
||||
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
||||
int nlocalsplus = code->co_nlocalsplus;
|
||||
size_t size = nlocalsplus + code->co_stacksize +
|
||||
FRAME_SPECIALS_SIZE;
|
||||
CALL_STAT_INC(frames_pushed);
|
||||
InterpreterFrame *frame = _PyThreadState_BumpFramePointer(tstate, size);
|
||||
if (frame == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
_PyFrame_InitializeSpecials(frame, func, locals, nlocalsplus);
|
||||
for (int i=0; i < nlocalsplus; i++) {
|
||||
frame->localsplus[i] = NULL;
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
void
|
||||
_PyThreadState_PopFrame(PyThreadState *tstate, InterpreterFrame * frame)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue