fix bug in __Pyx_SetItemInt_Fast
authorLisandro Dalcin <dalcinl@gmail.com>
Mon, 6 Apr 2009 17:08:13 +0000 (14:08 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Mon, 6 Apr 2009 17:08:13 +0000 (14:08 -0300)
Cython/Compiler/ExprNodes.py

index 0b03f89404416d367cb2184d012d4da162beb2a0..f710f80c1af3cf9932a0eb21727654d6a644f14b 100644 (file)
@@ -5500,8 +5500,8 @@ static INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v
 
 static INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) {
     if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        Py_DECREF(PyList_GET_ITEM(o, i));
         Py_INCREF(v);
+        Py_DECREF(PyList_GET_ITEM(o, i));
         PyList_SET_ITEM(o, i, v);
         return 1;
     }