diff --git a/Objects/frameobject.c b/Objects/frameobject.c index a933c4a6912..3a073b6fa02 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -642,6 +642,7 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals, f->f_trace = NULL; f->f_exc_type = f->f_exc_value = f->f_exc_traceback = NULL; } + f->f_stacktop = f->f_valuestack; f->f_builtins = builtins; Py_XINCREF(back); f->f_back = back; @@ -672,7 +673,6 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals, f->f_lineno = code->co_firstlineno; f->f_iblock = 0; - f->f_stacktop = f->f_valuestack; _PyObject_GC_TRACK(f); return f; }