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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23914 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-10-23 23:54:56 +00:00
parent 667eeca19d
commit 3db4b62c2f

View File

@ -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: {