Message270460
Inspired by Issue 27473, I did a quick and dirty scan for obvious places that expect overflow to wrap, and found the following, which I think should be fixed:
Modules/_ctypes/_ctypes.c:1388, in PyCArrayType_new()
Objects/listobject.c:492, in list_concat()
Objects/tupleobject.c:457, in tupleconcat()
Objects/listobject.c:845, in listextend()
Also I played with enabling GCC’s -ftrapv option. Attached is a patch with three changes:
1. configure --with-pydebug enables -ftrapv (experimental, not sure everyone would want this)
2. Easy fix for negation overflow in audioop (I am happy to apply this part)
3. Avoid dumb overflows at end of for loop in Element Tree code when handling slices with step=sys.maxsize. Technically the overflow is undefined behaviour, but the change is annoying, because ignoring the overflow at the end of the loop is much simpler than adding special cases. Not sure what I think about this part. |
|
Date |
User |
Action |
Args |
2016-07-15 02:53:37 | martin.panter | set | recipients:
+ martin.panter, gvanrossum, loewis, nnorwitz, gregory.p.smith, jcea, mark.dickinson, pitrou, vstinner, christian.heimes, alexandre.vassalotti, donmez, matejcik, jwilk, alex, dmalcolm, python-dev, deadshort, ztane, fweimer, Jeffrey.Walton |
2016-07-15 02:53:36 | martin.panter | set | messageid: <1468551216.85.0.516904819054.issue1621@psf.upfronthosting.co.za> |
2016-07-15 02:53:36 | martin.panter | link | issue1621 messages |
2016-07-15 02:53:34 | martin.panter | create | |
|