diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2018-03-16 21:25:12 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2018-03-16 21:25:12 -0700 |
commit | e50672cf37d4e071a9ab012b4d72a3dc62f1f817 (patch) | |
tree | e721722ca7650fb9c51f44c286e563b37e9d822b /tests/data/utftest_utf16_le_bom.xml | |
parent | 9540016f6d9e56bc02cc98218c930e00efd3f67c (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/data/utftest_utf16_le_bom.xml')
0 files changed, 0 insertions, 0 deletions