Fix off-by-one error in OP_FILLED_NEW_ARRAY_RANGE
Now 003-omnibus-opcode makes it to the UnresTest section, where
it dies with a segfault doing something verifier-related.
Change-Id: I8c2c746e16d951f297ecc61402907d70c68d09c1
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index 4a65771..f57094f 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -118,7 +118,7 @@
opRegRegImm(cUnit, kOpAdd, rDst, r0,
Array::DataOffset().Int32Value());
// Set up the loop counter (known to be > 0)
- loadConstant(cUnit, rIdx, dInsn->vA);
+ loadConstant(cUnit, rIdx, dInsn->vA - 1);
// Generate the copy loop. Going backwards for convenience
ArmLIR* target = newLIR0(cUnit, kArmPseudoTargetLabel);
target->defMask = ENCODE_ALL;
@@ -127,7 +127,7 @@
storeBaseIndexed(cUnit, rDst, rIdx, rVal, 2, kWord);
// Use setflags encoding here
newLIR3(cUnit, kThumb2SubsRRI12, rIdx, rIdx, 1);
- ArmLIR* branch = opCondBranch(cUnit, kArmCondNe);
+ ArmLIR* branch = opCondBranch(cUnit, kArmCondGe);
branch->generic.target = (LIR*)target;
} else if (!isRange) {
// TUNING: interleave