The previous version of dumper implemented UTF-16 byte swap incorrectly
on big-endian machines. This now gets fixed.
Thanks to Bill Seurer for testing the patch locally.
Differential Review: https://reviews.llvm.org/D38150
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313912
91177308-0d34-0410-b5e6-
96231b3b80d8
for (UTF16 Ch : UTF16Str) {
// UTF16Str will have swapped byte order in case of big-endian machines.
// Swap it back in such a case.
- support::ulittle16_t ChValue(Ch);
+ uint16_t ChValue = support::endian::byte_swap(Ch, support::little);
if (ChValue <= 0xFF)
Result += ChValue;
else