diff options
author | Chris Lattner <sabre@nondot.org> | 2005-10-23 23:54:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-10-23 23:54:56 +0000 |
commit | 3db4b62c2fa43b23fa02d32a7d3253885acafb9f (patch) | |
tree | fe7b21214b2a47353463afe00a493cda69573c46 /lib/ExecutionEngine | |
parent | 667eeca19ddbefd42d596afe6446c1aaa6bc136a (diff) | |
download | external_llvm-3db4b62c2fa43b23fa02d32a7d3253885acafb9f.zip external_llvm-3db4b62c2fa43b23fa02d32a7d3253885acafb9f.tar.gz external_llvm-3db4b62c2fa43b23fa02d32a7d3253885acafb9f.tar.bz2 |
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
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 36f7d2f..d8bd8f4 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -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: { |