• Marcus Holland-Moritz's avatar
    Fix undefined behaviour in 128-bit integer-to-string conversion · f97b156e
    Marcus Holland-Moritz authored
    Summary:
    The code to convert signed 128-bit integer values to strings would trigger
    undefined behaviour when trying to convert the most negative possible value,
    as exposed by the new test cases.
    
    The fix is to negate the corresponding unsigned value (just like it's already
    done for the 64-bit code).
    
    This change doesn't have any performance impact.
    
    Reviewed By: yfeldblum
    
    Differential Revision: D3455817
    
    fbshipit-source-id: 83782992324f443789760a0e61cd9b889faaf317
    f97b156e
ConvTest.cpp 25.6 KB