Move initialization to after the asserts for non-NULL values.
Klocwork 286-287.
(I'm not backporting this, but if someone wants to, feel free.)
diff --git a/Objects/listobject.c b/Objects/listobject.c
index ad27644..ef3700f 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -1398,7 +1398,7 @@
PyObject *compare;
PyObject **dest;
int result = -1; /* guilty until proved innocent */
- Py_ssize_t min_gallop = ms->min_gallop;
+ Py_ssize_t min_gallop;
assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb);
if (MERGE_GETMEM(ms, na) < 0)
@@ -1414,6 +1414,7 @@
if (na == 1)
goto CopyB;
+ min_gallop = ms->min_gallop;
compare = ms->compare;
for (;;) {
Py_ssize_t acount = 0; /* # of times A won in a row */
@@ -1531,7 +1532,7 @@
int result = -1; /* guilty until proved innocent */
PyObject **basea;
PyObject **baseb;
- Py_ssize_t min_gallop = ms->min_gallop;
+ Py_ssize_t min_gallop;
assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb);
if (MERGE_GETMEM(ms, nb) < 0)
@@ -1550,6 +1551,7 @@
if (nb == 1)
goto CopyA;
+ min_gallop = ms->min_gallop;
compare = ms->compare;
for (;;) {
Py_ssize_t acount = 0; /* # of times A won in a row */