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 | a551033ea86e5f6281a5b642a4cdc618b58c0ba3 (patch) | |
| tree | 550ab5809d222f3ea04f533f52ecc5f58991c36e /llvm/lib/ExecutionEngine | |
| parent | ac230143556b9847d557c8d2357b4cba95223c31 (diff) | |
| download | bcm5719-llvm-a551033ea86e5f6281a5b642a4cdc618b58c0ba3.tar.gz bcm5719-llvm-a551033ea86e5f6281a5b642a4cdc618b58c0ba3.zip | |
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
Diffstat (limited to 'llvm/lib/ExecutionEngine')
| -rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 36f7d2fdfc4..d8bd8f44aa3 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/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: { |

