Fix Casting
authorDavid Greene <greened@obbligato.org>
Mon, 14 Jan 2013 21:04:45 +0000 (21:04 +0000)
committerDavid Greene <greened@obbligato.org>
Mon, 14 Jan 2013 21:04:45 +0000 (21:04 +0000)
Do proper casting to eliminate a const-away-cast compiler warning.

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

lib/ExecutionEngine/ExecutionEngine.cpp

index ef5f589896866ae64f6e4a4fb6f4cab72b08332b..6f71ffb2fa54f8a3a609505566f45ea9aed3c700 100644 (file)
@@ -893,7 +893,8 @@ void ExecutionEngine::StoreValueToMemory(const GenericValue &Val,
 /// from Src into IntVal, which is assumed to be wide enough and to hold zero.
 static void LoadIntFromMemory(APInt &IntVal, uint8_t *Src, unsigned LoadBytes) {
   assert((IntVal.getBitWidth()+7)/8 >= LoadBytes && "Integer too small!");
-  uint8_t *Dst = (uint8_t *)IntVal.getRawData();
+  uint8_t *Dst = reinterpret_cast<uint8_t *>(
+                   const_cast<uint64_t *>(IntVal.getRawData()));
 
   if (sys::isLittleEndianHost())
     // Little-endian host - the destination must be ordered from LSB to MSB.