SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 110 Python

pytime: add _PyTime_check_mul_overflow() macro to avoid undefined behaviour

Overflow test in test_FromSecondsObject() fails on FreeBSD 10.0 buildbot which
uses clang. clang implements more aggressive optimization which gives
different result than GCC on undefined behaviours.

Check if a multiplication will overflow, instead of checking if a
multiplicatin had overflowed, to avoid undefined behaviour.

Add also debug information if the test on overflow fails.
V
Victor Stinner committed
c60542b12bdf11487b959bbb304f4ea194be6a19
Parent: ff0ed3e