Quick compiler: fix array undershoot
Normal Dalvik vRegs range from 0..n. However, we use negative
vReg positions to denote special values such as Method* and other
things we might wish to promote. Failed to take this into account
for some shadow frame bitcode conversion stuff.
Yet another datapoint supporting the upcoming C++ification.
Change-Id: I3a1714ac1a80763c048dda3ae95125fc6082202b
diff --git a/src/compiler/codegen/MethodBitcode.cc b/src/compiler/codegen/MethodBitcode.cc
index 31fc9cf..f4b8461 100644
--- a/src/compiler/codegen/MethodBitcode.cc
+++ b/src/compiler/codegen/MethodBitcode.cc
@@ -1796,7 +1796,10 @@
cUnit->numDalvikRegisters, true,
kAllocMisc);
for (int i = 0; i < cUnit->numSSARegs; i++) {
- canBeRef[SRegToVReg(cUnit, i)] |= cUnit->regLocation[i].ref;
+ int vReg = SRegToVReg(cUnit, i);
+ if (vReg > SSA_METHOD_BASEREG) {
+ canBeRef[SRegToVReg(cUnit, i)] |= cUnit->regLocation[i].ref;
+ }
}
for (int i = 0; i < cUnit->numDalvikRegisters; i++) {
if (canBeRef[i]) {