]> granicus.if.org Git - python/commitdiff
f_code can't be NULL based on Frame_New and other code that derefs it.
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Jun 2006 05:48:14 +0000 (05:48 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Jun 2006 05:48:14 +0000 (05:48 +0000)
So there doesn't seem to be much point to checking here.

Objects/frameobject.c

index fcb5e4e32c4fcc70573b779f52278bad19987fd9..06c3c7a9505620f56bbbf6b64fa631e535faa657 100644 (file)
@@ -425,7 +425,7 @@ frame_dealloc(PyFrameObject *f)
        Py_CLEAR(f->f_exc_traceback);
 
         co = f->f_code;
-        if (co != NULL && co->co_zombieframe == NULL)
+        if (co->co_zombieframe == NULL)
                 co->co_zombieframe = f;
        else if (numfree < MAXFREELIST) {
                ++numfree;
@@ -435,7 +435,7 @@ frame_dealloc(PyFrameObject *f)
        else 
                PyObject_GC_Del(f);
 
-        Py_XDECREF(co);
+        Py_DECREF(co);
        Py_TRASHCAN_SAFE_END(f)
 }