Message271766
The check in ins1() was originally added in revision b9002da46f69. I presume it references the Python-dev thread “can this overflow (list insertion)?” <20000812145155.A7629@ActiveState.com>, <https://marc.info/?l=python-dev&m=107666472818169>. At that time, ob_size was an int, so overflow checking was definitely needed. Later, revision 7fdc639bc5b4 changed ob_size to Py_ssize_t, and then revision 606818c33e50 updated the overflow check from INT_MAX to PY_SSIZE_T_MAX.
BTW I made a small mistake in my previous message. The worst case would be extending a list with itself. But I think the conclusion is still the same. |
|
Date |
User |
Action |
Args |
2016-08-01 04:25:54 | martin.panter | set | recipients:
+ martin.panter, loewis, nnorwitz, jcea, mark.dickinson, pitrou, vstinner, christian.heimes, alexandre.vassalotti, donmez, matejcik, jwilk, alex, dmalcolm, python-dev, deadshort, serhiy.storchaka, ztane, fweimer, Jeffrey.Walton, xiang.zhang |
2016-08-01 04:25:54 | martin.panter | set | messageid: <1470025554.6.0.702212321678.issue1621@psf.upfronthosting.co.za> |
2016-08-01 04:25:54 | martin.panter | link | issue1621 messages |
2016-08-01 04:25:53 | martin.panter | create | |
|