commit | c60542b12bdf11487b959bbb304f4ea194be6a19 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@gmail.com> | Thu Sep 10 15:55:07 2015 +0200 |
committer | Victor Stinner <victor.stinner@gmail.com> | Thu Sep 10 15:55:07 2015 +0200 |
tree | 8348fc4667e247b4f382dfc263dcb9b8f559c1f0 | |
parent | ff0ed3e71cb828103cf21442231686f1b348479b [diff] |
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.