aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/Interpreter/Execution.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 298ce2c2b9..46ed6fdfbf 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -654,8 +654,11 @@ void Interpreter::visitSwitchInst(SwitchInst &I) {
ConstantRangesSet Case = i.getCaseValueEx();
for (unsigned n = 0, en = Case.getNumItems(); n != en; ++n) {
ConstantRangesSet::Range r = Case.getItem(n);
- GenericValue Low = getOperandValue(r.Low, SF);
- GenericValue High = getOperandValue(r.High, SF);
+ // FIXME: Currently work with ConstantInt based numbers.
+ const ConstantInt *LowCI = r.Low.getImplementation();
+ const ConstantInt *HighCI = r.High.getImplementation();
+ GenericValue Low = getOperandValue(const_cast<ConstantInt*>(LowCI), SF);
+ GenericValue High = getOperandValue(const_cast<ConstantInt*>(HighCI), SF);
if (executeICMP_ULE(Low, CondVal, ElTy).IntVal != 0 &&
executeICMP_ULE(CondVal, High, ElTy).IntVal != 0) {
Dest = cast<BasicBlock>(i.getCaseSuccessor());