diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/frameobject.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index c38c5fb..6af4e6e 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -78,9 +78,11 @@ frame_dealloc(PyFrameObject *f) } /* Free stack */ - for (p = f->f_valuestack; p < f->f_stackbottom; p++) { - Py_XDECREF(*p); + if (f->f_stacktop != NULL) { + for (p = f->f_valuestack; p < f->f_stacktop; p++) + Py_XDECREF(*p); } + Py_XDECREF(f->f_back); Py_XDECREF(f->f_code); Py_XDECREF(f->f_builtins); @@ -226,7 +228,7 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals, f->f_localsplus[extras] = NULL; f->f_valuestack = f->f_localsplus + (f->f_nlocals + ncells + nfrees); - f->f_stackbottom = f->f_valuestack; + f->f_stacktop = f->f_valuestack; return f; } |