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. llvm-svn: 130395
This commit is contained in:
parent
6e1f9babcd
commit
93da3c8233
|
@ -839,7 +839,7 @@ void ExecutionEngine::StoreValueToMemory(const GenericValue &Val,
|
||||||
case Type::PointerTyID:
|
case Type::PointerTyID:
|
||||||
// Ensure 64 bit target pointers are fully initialized on 32 bit hosts.
|
// Ensure 64 bit target pointers are fully initialized on 32 bit hosts.
|
||||||
if (StoreBytes != sizeof(PointerTy))
|
if (StoreBytes != sizeof(PointerTy))
|
||||||
memset(Ptr, 0, StoreBytes);
|
memset(&(Ptr->PointerVal), 0, StoreBytes);
|
||||||
|
|
||||||
*((PointerTy*)Ptr) = Val.PointerVal;
|
*((PointerTy*)Ptr) = Val.PointerVal;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue