summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/WindowsResource.cpp
diff options
context:
space:
mode:
authorEric Beckmann <ecbeckmann@google.com>2017-06-13 20:36:19 +0000
committerEric Beckmann <ecbeckmann@google.com>2017-06-13 20:36:19 +0000
commit338663348a5ce7d3d72723f35c05dfeb908e95f7 (patch)
tree3547639722b439f90bb294a914782020dda473ac /llvm/lib/Object/WindowsResource.cpp
parent4ebb0f061a52c285a35ef3244a7dd7c21fe9164f (diff)
downloadbcm5719-llvm-338663348a5ce7d3d72723f35c05dfeb908e95f7.tar.gz
bcm5719-llvm-338663348a5ce7d3d72723f35c05dfeb908e95f7.zip
Fix alignment complaint.
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 llvm-svn: 305320
Diffstat (limited to 'llvm/lib/Object/WindowsResource.cpp')
-rw-r--r--llvm/lib/Object/WindowsResource.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Object/WindowsResource.cpp b/llvm/lib/Object/WindowsResource.cpp
index b1452e8d5e9..fdf4690e604 100644
--- a/llvm/lib/Object/WindowsResource.cpp
+++ b/llvm/lib/Object/WindowsResource.cpp
@@ -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() {
OpenPOWER on IntegriCloud