summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-07-21 05:31:02 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-07-21 05:31:02 (GMT)
commit1adbb507013bea05cda92ea6aa9a8fef72657923 (patch)
treed4c3c06385cb7c8f36bc433bb484d85d96cb0066 /Objects
parent48808a1d6c3996ed06e904becdfb4cfadbef09cb (diff)
downloadcpython-1adbb507013bea05cda92ea6aa9a8fef72657923.zip
cpython-1adbb507013bea05cda92ea6aa9a8fef72657923.tar.gz
cpython-1adbb507013bea05cda92ea6aa9a8fef72657923.tar.bz2
Move the initialization of some pointers earlier. The problem is
that if we call Py_DECREF(frame) like we do if allocating locals fails, frame_dealloc() will try to use these bogus values and crash.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/frameobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index a933c4a..3a073b6 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;
}