summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRInterpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Expression/IRInterpreter.cpp')
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index b3c35bf8e9a..5986ebb4a00 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -662,12 +662,16 @@ IRInterpreter::Interpret (llvm::Module &module,
result = L - R;
break;
case Instruction::SDiv:
+ L.MakeSigned();
+ R.MakeSigned();
result = L / R;
break;
case Instruction::UDiv:
result = L.GetRawBits64(0) / R.GetRawBits64(1);
break;
case Instruction::SRem:
+ L.MakeSigned();
+ R.MakeSigned();
result = L % R;
break;
case Instruction::URem:
@@ -1004,15 +1008,23 @@ IRInterpreter::Interpret (llvm::Module &module,
result = (L.GetRawBits64(0) <= R.GetRawBits64(0));
break;
case CmpInst::ICMP_SGT:
+ L.MakeSigned();
+ R.MakeSigned();
result = (L > R);
break;
case CmpInst::ICMP_SGE:
+ L.MakeSigned();
+ R.MakeSigned();
result = (L >= R);
break;
case CmpInst::ICMP_SLT:
+ L.MakeSigned();
+ R.MakeSigned();
result = (L < R);
break;
case CmpInst::ICMP_SLE:
+ L.MakeSigned();
+ R.MakeSigned();
result = (L <= R);
break;
}
OpenPOWER on IntegriCloud