mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Move the initialization of size_a down below the check for a being NULL.
Reported by Klocwork #106
This commit is contained in:
parent
f71847e645
commit
c09efa8444
1 changed files with 2 additions and 1 deletions
|
@ -1203,7 +1203,7 @@ long_format(PyObject *aa, int base, int addL)
|
||||||
register PyLongObject *a = (PyLongObject *)aa;
|
register PyLongObject *a = (PyLongObject *)aa;
|
||||||
PyStringObject *str;
|
PyStringObject *str;
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
const Py_ssize_t size_a = ABS(a->ob_size);
|
Py_ssize_t size_a;
|
||||||
char *p;
|
char *p;
|
||||||
int bits;
|
int bits;
|
||||||
char sign = '\0';
|
char sign = '\0';
|
||||||
|
@ -1213,6 +1213,7 @@ long_format(PyObject *aa, int base, int addL)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
assert(base >= 2 && base <= 36);
|
assert(base >= 2 && base <= 36);
|
||||||
|
size_a = ABS(a->ob_size);
|
||||||
|
|
||||||
/* Compute a rough upper bound for the length of the string */
|
/* Compute a rough upper bound for the length of the string */
|
||||||
i = base;
|
i = base;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue