This is an archive of the discontinued LLVM Phabricator instance.

Fix a bug introduced in r305092 on big-endian systems.
ClosedPublic

Authored by ecbeckmann on Jun 13 2017, 12:13 PM.

Details

Summary

We were writing the length of the string based on system-endianness, and
not universally little-endian. This fixes that.

Event Timeline

ecbeckmann created this revision.Jun 13 2017, 12:13 PM
ruiu added a subscriber: ruiu.Jun 13 2017, 12:23 PM

Yes, write{16,32,64}le is usually much more convenient than casting to ulittle{16,32,64}_t.

Use writele16 instead of casting.

This revision was automatically updated to reflect the committed changes.
ruiu added inline comments.Jun 13 2017, 1:56 PM
llvm/lib/Object/WindowsResource.cpp
694–696

Don't you want to make this a reference? You are making a copy of a vector.

Good point, I'll change this in a future patch

ruiu added a comment.Jun 13 2017, 2:00 PM

You can do it in a single-line follow-up patch. It is actually more preferable than doing it in an unrelated patch.