diff options
author | Vedant Kumar <vsk@apple.com> | 2017-06-10 18:07:24 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2017-06-10 18:07:24 +0000 |
commit | c6e9e3007b25ce5e53cd3c87a093aef6bbb5024c (patch) | |
tree | be3cf95d258b90abb4f061d4a7ac235c063897da /llvm/lib/Object/WindowsResource.cpp | |
parent | 5806d9f205f88c77ea071c0af8444830896f038b (diff) | |
download | llvm-c6e9e3007b25ce5e53cd3c87a093aef6bbb5024c.zip llvm-c6e9e3007b25ce5e53cd3c87a093aef6bbb5024c.tar.gz llvm-c6e9e3007b25ce5e53cd3c87a093aef6bbb5024c.tar.bz2 |
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
Diffstat (limited to 'llvm/lib/Object/WindowsResource.cpp')
-rw-r--r-- | llvm/lib/Object/WindowsResource.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/WindowsResource.cpp b/llvm/lib/Object/WindowsResource.cpp index 041659e..3a1ed9a 100644 --- a/llvm/lib/Object/WindowsResource.cpp +++ b/llvm/lib/Object/WindowsResource.cpp @@ -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() { |