Move the initialization of size_a down below the check for a being NULL.
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 23 Jul 2006 07:53:14 +0000 (07:53 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 23 Jul 2006 07:53:14 +0000 (07:53 +0000)
Reported by Klocwork #106

Objects/longobject.c

index cbd6f2be593ed713df5b91aede6e4a9263dc1cad..4ce947955a98baa57e1a7e1929d8435daec8d1ec 100644 (file)
@@ -1203,7 +1203,7 @@ long_format(PyObject *aa, int base, int addL)
        register PyLongObject *a = (PyLongObject *)aa;
        PyStringObject *str;
        Py_ssize_t i;
-       const Py_ssize_t size_a = ABS(a->ob_size);
+       Py_ssize_t size_a;
        char *p;
        int bits;
        char sign = '\0';
@@ -1213,6 +1213,7 @@ long_format(PyObject *aa, int base, int addL)
                return NULL;
        }
        assert(base >= 2 && base <= 36);
+       size_a = ABS(a->ob_size);
 
        /* Compute a rough upper bound for the length of the string */
        i = base;