aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp5
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: {