summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-04-28 08:37:18 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-04-28 08:37:18 +0000
commit80d9e072625bc49dab4fa2da6c21bdd202509ee3 (patch)
tree49a86a5847f3b34a4e0b39491d350242c8f36d23 /lib/ExecutionEngine/ExecutionEngine.cpp
parentd7797496a36b46fc8a1c6a96c8a2ccbe53929567 (diff)
downloadllvm-80d9e072625bc49dab4fa2da6c21bdd202509ee3.tar.gz
llvm-80d9e072625bc49dab4fa2da6c21bdd202509ee3.tar.bz2
llvm-80d9e072625bc49dab4fa2da6c21bdd202509ee3.tar.xz
Fix the last -Wnon-pod-memset I'm seeing. This is benign, but appears
a bit more sinister as the memset doesn't do what the constructor does. There seems to be a cleaner solution than a cast here though, instead we can point the memset destination into the union its actually trying to clear. An alternative is to point to the Untyped member of this union. Review appreciated, and if that is cleaner I'm happy to switch. All of these should be functionally equivalent to the original code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 6d767be492..2b1e8786c7 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -839,7 +839,7 @@ void ExecutionEngine::StoreValueToMemory(const GenericValue &Val,
case Type::PointerTyID:
// Ensure 64 bit target pointers are fully initialized on 32 bit hosts.
if (StoreBytes != sizeof(PointerTy))
- memset(Ptr, 0, StoreBytes);
+ memset(&(Ptr->PointerVal), 0, StoreBytes);
*((PointerTy*)Ptr) = Val.PointerVal;
break;