Message232367
> Also, PY_SSIZE_T_MAX is a valid value to pass to PySequence_GetItem(), so it shouldn't be blocked unless necessary.
I agree with you, that's why my first path was checking at the next call if it->it_index had overflowed. But then it relies on undefined behaviour.
> I would think that the PY_SSIZE_T_MAX check belongs inside the:
>
> if (result != NULL) {
> it->it_index++;
> return result;
> }
If we raise the OverflowError when it->it_index really overflow (just after the getitem PY_SSIZE_T_MAX).
Is it really necessary to do the overflow check after the GetItem ? because the value returned by `PySequence_GetItem(seq, PY_SSIZE_T_MAX);` will be never used. |
|
Date |
User |
Action |
Args |
2014-12-09 10:46:39 | hakril | set | recipients:
+ hakril, rhettinger, mark.dickinson, vstinner, r.david.murray, serhiy.storchaka |
2014-12-09 10:46:39 | hakril | set | messageid: <1418121999.47.0.576207634511.issue22939@psf.upfronthosting.co.za> |
2014-12-09 10:46:39 | hakril | link | issue22939 messages |
2014-12-09 10:46:39 | hakril | create | |
|