diff options
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r-- | Objects/frameobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 15da132..78f3894 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -784,6 +784,8 @@ _Py_IDENTIFIER(__builtins__); static void init_frame(InterpreterFrame *frame, PyFunctionObject *func, PyObject *locals) { + /* _PyFrame_InitializeSpecials consumes reference to func */ + Py_INCREF(func); PyCodeObject *code = (PyCodeObject *)func->func_code; _PyFrame_InitializeSpecials(frame, func, locals, code->co_nlocalsplus); for (Py_ssize_t i = 0; i < code->co_nlocalsplus; i++) { |