I can't lgtm right no, not at computer.  Can use llvm::support::write16le instead of the pointer assignment?  Otherwise lgtm<br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 13, 2017 at 12:13 PM Eric Beckmann via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ecbeckmann created this revision.<br>
Herald added a subscriber: hiraditya.<br>
<br>
We were writing the length of the string based on system-endianness, and<br>
not universally little-endian.  This fixes that.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D34159" rel="noreferrer" target="_blank">https://reviews.llvm.org/D34159</a><br>
<br>
Files:<br>
  llvm/lib/Object/WindowsResource.cpp<br>
<br>
<br>
Index: llvm/lib/Object/WindowsResource.cpp<br>
===================================================================<br>
--- llvm/lib/Object/WindowsResource.cpp<br>
+++ llvm/lib/Object/WindowsResource.cpp<br>
@@ -693,7 +693,7 @@<br>
   uint32_t TotalStringTableSize = 0;<br>
   for (auto String : StringTable) {<br>
     auto *LengthField =<br>
-        reinterpret_cast<uint16_t *>(BufferStart + CurrentOffset);<br>
+        reinterpret_cast<support::ulittle16_t *>(BufferStart + CurrentOffset);<br>
     uint16_t Length = String.size();<br>
     *LengthField = Length;<br>
     CurrentOffset += sizeof(uint16_t);<br>
<br>
<br>
</blockquote></div>