mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[llvm-readobj] Fix 'Teach readobj to dump .res files', pt 2.
Another fix-up for r313790. Big-endian hosts swapped byte order in UTF16 words. llvm-svn: 313833
This commit is contained in:
parent
ec81f6718b
commit
0c12f89e99
@ -26,8 +26,11 @@ std::string stripUTF16(const ArrayRef<UTF16> &UTF16Str) {
|
||||
Result.reserve(UTF16Str.size());
|
||||
|
||||
for (UTF16 Ch : UTF16Str) {
|
||||
if (Ch <= 0xFF)
|
||||
Result += Ch;
|
||||
// UTF16Str will have swapped byte order in case of big-endian machines.
|
||||
// Swap it back in such a case.
|
||||
ulittle16_t ChValue = Ch;
|
||||
if (ChValue <= 0xFF)
|
||||
Result += ChValue;
|
||||
else
|
||||
Result += '?';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user