diff options
author | Mark Shannon <mark@hotpy.org> | 2022-02-03 18:36:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-03 18:36:28 (GMT) |
commit | da4d4ec1851714bb56a5e8d0c1cd5bf9842b4cee (patch) | |
tree | 0a59b7362a584322ba0042f411b28555353b4a67 /Include | |
parent | 2d080347d74078a55c47715d232d1ab8dc8cd603 (diff) | |
download | cpython-da4d4ec1851714bb56a5e8d0c1cd5bf9842b4cee.zip cpython-da4d4ec1851714bb56a5e8d0c1cd5bf9842b4cee.tar.gz cpython-da4d4ec1851714bb56a5e8d0c1cd5bf9842b4cee.tar.bz2 |
Pass reference to func, as well as args, when pushing frame. (GH-31100)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_frame.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h index 85b9cf0..1ad1562 100644 --- a/Include/internal/pycore_frame.h +++ b/Include/internal/pycore_frame.h @@ -87,12 +87,12 @@ static inline void _PyFrame_StackPush(InterpreterFrame *f, PyObject *value) { void _PyFrame_Copy(InterpreterFrame *src, InterpreterFrame *dest); +/* Consumes reference to func */ static inline void _PyFrame_InitializeSpecials( InterpreterFrame *frame, PyFunctionObject *func, PyObject *locals, int nlocalsplus) { - Py_INCREF(func); frame->f_func = func; frame->f_code = (PyCodeObject *)Py_NewRef(func->func_code); frame->f_builtins = func->func_builtins; @@ -166,9 +166,6 @@ _PyFrame_FastToLocalsWithError(InterpreterFrame *frame); void _PyFrame_LocalsToFast(InterpreterFrame *frame, int clear); -InterpreterFrame *_PyThreadState_PushFrame( - PyThreadState *tstate, PyFunctionObject *func, PyObject *locals); - extern InterpreterFrame * _PyThreadState_BumpFramePointerSlow(PyThreadState *tstate, size_t size); @@ -189,6 +186,7 @@ _PyThreadState_BumpFramePointer(PyThreadState *tstate, size_t size) void _PyThreadState_PopFrame(PyThreadState *tstate, InterpreterFrame *frame); +/* Consume reference to func */ InterpreterFrame * _PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func); |