New issue 3065: range() with large step causes undefined behaviour
https://bitbucket.org/pypy/pypy/issues/3065/range-with-large-step-causes-undefined
Ronan Lamy:
With positive step, range\(start, stop, step\) translates roughly like:
```python
def range(start, stop, step):
cur = start
while cur < stop:
yield cur
cur += step
```
Signed integer overflow, which is undefined behaviour in C, may happen on the
line `cur += step`, e.g. if start \+ step > sys.maxint.
Note: this caused the issue fixed in be2a55c81f26
_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue