• Victor Stinner's avatar
    pytime: add _PyTime_check_mul_overflow() macro to avoid undefined behaviour · c60542b1
    Victor Stinner yazdı
    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.
    c60542b1
test_time.py 35.5 KB