forked from OSchip/llvm-project
[llvm-readobj] Fix big-endian byte swap in WindowsResourceDumper.
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 llvm-svn: 313912
This commit is contained in:
parent
142e0cf08e
commit
b63355ef77
|
@ -29,7 +29,7 @@ std::string stripUTF16(const ArrayRef<UTF16> &UTF16Str) {
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue