Commit 09240f65 authored by Guido van Rossum's avatar Guido van Rossum

GCC was complaining that 'value' in dictiter_iternextvalue() wasn't

necessarily always set before used.  Between Tim, Armin & me we
couldn't prove GCC wrong, so we decided to fix the algorithm.  This
version is Armin's.
parent fe703e06
...@@ -2148,15 +2148,16 @@ static PyObject *dictiter_iternextvalue(dictiterobject *di) ...@@ -2148,15 +2148,16 @@ static PyObject *dictiter_iternextvalue(dictiterobject *di)
} }
i = di->di_pos; i = di->di_pos;
if (i < 0) mask = d->ma_mask;
if (i < 0 || i > mask)
goto fail; goto fail;
ep = d->ma_table; ep = d->ma_table;
mask = d->ma_mask; while ((value=ep[i].me_value) == NULL) {
while (i <= mask && (value=ep[i].me_value) == NULL)
i++; i++;
if (i > mask)
goto fail;
}
di->di_pos = i+1; di->di_pos = i+1;
if (i > mask)
goto fail;
di->len--; di->len--;
Py_INCREF(value); Py_INCREF(value);
return value; return value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment