summaryrefslogtreecommitdiff
path: root/tests/test_unicode.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-03-16 21:25:12 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-03-16 21:25:12 -0700
commite50672cf37d4e071a9ab012b4d72a3dc62f1f817 (patch)
treee721722ca7650fb9c51f44c286e563b37e9d822b /tests/test_unicode.cpp
parent9540016f6d9e56bc02cc98218c930e00efd3f67c (diff)
ubsan: Fix undefined behavior for signed left shift in compact mode
We were using << compact_alignment_log2 instead of * compact_alignment for symmetry with the encoding where >> is crucial to keep code fast and round to negative infinity. For decoding, the results are the same and any reasonable compiler should convert *4 into <<2 so just use a multiplication - that doesn't trigger UB on negative numbers.
Diffstat (limited to 'tests/test_unicode.cpp')
0 files changed, 0 insertions, 0 deletions