]> granicus.if.org Git - llvm/commitdiff
Fix alignment complaint.
authorEric Beckmann <ecbeckmann@google.com>
Tue, 13 Jun 2017 20:36:19 +0000 (20:36 +0000)
committerEric Beckmann <ecbeckmann@google.com>
Tue, 13 Jun 2017 20:36:19 +0000 (20:36 +0000)
Summary: Apparently we need to write using a void* pointer on some architectures, or else alignment error is caused.

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D34166

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305320 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Object/WindowsResource.cpp

index b1452e8d5e95a40d49edf3338e4ea15df9ae1696..fdf4690e60422c7821faafdd800fccc754e0d36c 100644 (file)
@@ -598,9 +598,8 @@ void WindowsResourceCOFFWriter::writeSymbolTable() {
 
 void WindowsResourceCOFFWriter::writeStringTable() {
   // Just 4 null bytes for the string table.
-  auto COFFStringTable =
-      reinterpret_cast<uint32_t *>(BufferStart + CurrentOffset);
-  *COFFStringTable = 0;
+  auto COFFStringTable = reinterpret_cast<void *>(BufferStart + CurrentOffset);
+  memset(COFFStringTable, 0, 4);
 }
 
 void WindowsResourceCOFFWriter::writeDirectoryTree() {