➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 martin.panter
收信人 Jeffrey.Walton, alex, alexandre.vassalotti, christian.heimes, deadshort, dmalcolm, donmez, fweimer, gregory.p.smith, gvanrossum, jcea, jwilk, loewis, mark.dickinson, martin.panter, matejcik, nnorwitz, pitrou, python-dev, serhiy.storchaka, vstinner, ztane
日期 2016-07-16.15:16:00
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1468682160.67.0.551884707716.issue1621@psf.upfronthosting.co.za>
In-reply-to
内容
I tried the newer -fsanitize=undefined mode, and it is better than -ftrapv. It adds instrumentation that by default nicely reports the errors and continues running.

My problem with the large slice step is not restricted to Element Tree; it affects list objects too:

>>> "abcdef"[3::sys.maxsize]
Objects/unicodeobject.c:13794:55: runtime error: signed integer overflow: 3 + 9223372036854775807 cannot be represented in type 'long int'
'd'

Regarding Antti’s overflow macros, I noticed there is already a macro _PyTime_check_mul_overflow() in Python/pytime.c which does that kind of thing. Maybe it could help, though I am not sure. Has this sort of thing been done in other projects? We might need to be careful about the sign, e.g. clarify the macro is only for positive values, add an assertion, or handle both positive and negative.
历史
日期 用户 动作 参数
2016-07-16 15:16:00martin.panter修改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, serhiy.storchaka, ztane, fweimer, Jeffrey.Walton
2016-07-16 15:16:00martin.panter修改messageid: <1468682160.67.0.551884707716.issue1621@psf.upfronthosting.co.za>
2016-07-16 15:16:00martin.panter链接issue1621 messages
2016-07-16 15:16:00martin.panter创建