TABLEDWITCH work on signed values.
llvm-svn: 60980
diff --git a/vmkit/lib/JnJVM/VMCore/JavaJITOpcodes.cpp b/vmkit/lib/JnJVM/VMCore/JavaJITOpcodes.cpp
index bca6245..83d3c89 100644
--- a/vmkit/lib/JnJVM/VMCore/JavaJITOpcodes.cpp
+++ b/vmkit/lib/JnJVM/VMCore/JavaJITOpcodes.cpp
@@ -1684,13 +1684,13 @@
i += filled;
BasicBlock* def = opcodeInfos[tmp + readU4(bytecodes, i)].newBlock;
- uint32 low = readU4(bytecodes, i);
- uint32 high = readU4(bytecodes, i) + 1;
+ sint32 low = readS4(bytecodes, i);
+ sint32 high = readS4(bytecodes, i) + 1;
Value* index = pop();
const llvm::Type* type = index->getType();
- for (uint32 cur = low; cur < high; ++cur) {
+ for (sint32 cur = low; cur < high; ++cur) {
Value* cmp = new ICmpInst(ICmpInst::ICMP_EQ,
ConstantInt::get(type, cur), index,
"", currentBlock);