forked from OSchip/llvm-project
Fix a nasty bug that was causing miscompilation of global variables
on big endian 32-bit targets in some cases (e.g. PPC). This fixes several PPC JIT failures. llvm-svn: 23914
This commit is contained in:
parent
ac23014355
commit
a551033ea8
|
@ -189,7 +189,10 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
|
|||
uint64_t Offset =
|
||||
TD->getIndexedOffset(CE->getOperand(0)->getType(), Indexes);
|
||||
|
||||
Result.LongVal += Offset;
|
||||
if (getTargetData().getPointerSize() == 4)
|
||||
Result.IntVal += Offset;
|
||||
else
|
||||
Result.LongVal += Offset;
|
||||
return Result;
|
||||
}
|
||||
case Instruction::Cast: {
|
||||
|
|
Loading…
Reference in New Issue