Fix a ubsan failure introduced by r305092

lib/Object/WindowsResource.cpp:578:3: runtime error: store to
misaligned address 0x7fa09aedebbe for type 'unsigned int', which
requires 4 byte alignment
0x7fa09aedebbe: note: pointer points here
00 00 03 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00
            ^

llvm-svn: 305149
This commit is contained in:
Vedant Kumar 2017-06-10 18:07:24 +00:00
parent 5806d9f205
commit c6e9e3007b
1 changed files with 2 additions and 2 deletions

View File

@ -574,8 +574,8 @@ void WindowsResourceCOFFWriter::writeSymbolTable() {
void WindowsResourceCOFFWriter::writeStringTable() {
// Just 4 null bytes for the string table.
auto COFFStringTable = reinterpret_cast<uint32_t *>(Current);
*COFFStringTable = 0;
auto COFFStringTable = reinterpret_cast<void *>(Current);
memset(COFFStringTable, 0, 4);
}
void WindowsResourceCOFFWriter::writeDirectoryTree() {