svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r76298 | mark.dickinson | 2009-11-15 12:56:08 +0000 (Sun, 15 Nov 2009) | 1 line
Fix another case of potential signed overflow.
........
rangeiter_next(rangeiterobject *r)
{
if (r->index < r->len)
- return PyLong_FromLong(r->start + (r->index++) * r->step);
+ /* cast to unsigned to avoid possible signed overflow
+ in intermediate calculations. */
+ return PyLong_FromLong((long)(r->start +
+ (unsigned long)(r->index++) * r->step));
return NULL;
}