fix memory-layout assumption which only holds on little-endian systems
authorGabor Greif <ggreif@gmail.com>
Fri, 22 Oct 2010 23:16:11 +0000 (23:16 +0000)
committerGabor Greif <ggreif@gmail.com>
Fri, 22 Oct 2010 23:16:11 +0000 (23:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117176 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMCodeEmitter.cpp

index 2b1239d921bd3f2c4e279eff91433b9588039821..78a73e2affb469abe0bf0250373180580becfd24 100644 (file)
@@ -505,7 +505,7 @@ void ARMCodeEmitter::emitConstPoolInstruction(const MachineInstr &MI) {
       emitGlobalAddress(GV, ARM::reloc_arm_absolute, isa<Function>(GV), false);
       emitWordLE(0);
     } else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
-      uint32_t Val = *(uint32_t*)CI->getValue().getRawData();
+      uint32_t Val = uint32_t(*CI->getValue().getRawData());
       emitWordLE(Val);
     } else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) {
       if (CFP->getType()->isFloatTy())