am 0b33af0c: am 5d992dfa: am 36bd1345: Fix for array lower-bound check for count-down loops.
diff --git a/vm/compiler/Loop.c b/vm/compiler/Loop.c
index 78f5717..918d955 100644
--- a/vm/compiler/Loop.c
+++ b/vm/compiler/Loop.c
@@ -435,11 +435,12 @@
boundCheckMIR->dalvikInsn.vA = loopAnalysis->endConditionReg;
boundCheckMIR->dalvikInsn.vB = globalMinC;
/*
- * If the end condition is ">", add 1 back to the constant field
- * to reflect the fact that the smallest index value is
- * "endValue + constant + 1".
+ * If the end condition is ">" in the source, the check in the
+ * Dalvik bytecode is OP_IF_LE. In this case add 1 back to the
+ * constant field to reflect the fact that the smallest index
+ * value is "endValue + constant + 1".
*/
- if (loopAnalysis->loopBranchOpcode == OP_IF_LT) {
+ if (loopAnalysis->loopBranchOpcode == OP_IF_LE) {
boundCheckMIR->dalvikInsn.vB++;
}
dvmCompilerAppendMIR(entry, boundCheckMIR);