dvmFindSystemClassNoInit("Ljava/lang/Object;");
if (meth->registersSize * insnsSize > 4*1024*1024) {
- /* should probably base this on actual memory requirements */
LOG_VFY_METH(meth,
- "VFY: arbitrarily rejecting large method (regs=%d count=%d)\n",
+ "VFY: warning: method is huge (regs=%d insnsSize=%d)\n",
meth->registersSize, insnsSize);
- goto bail;
+ /* might be bogus data, might be some huge generated method */
}
/*
bool dvmCheckSwitchTargets(const Method* meth, InsnFlags* insnFlags,
int curOffset)
{
- const int insnCount = dvmGetMethodInsnsSize(meth);
+ const s4 insnCount = dvmGetMethodInsnsSize(meth);
const u2* insns = meth->insns + curOffset;
const u2* switchInsns;
u2 expectedSignature;
- int switchCount, tableSize;
- int offsetToSwitch, offsetToKeys, offsetToTargets, targ;
- int offset, absOffset;
+ u4 switchCount, tableSize;
+ s4 offsetToSwitch, offsetToKeys, offsetToTargets;
+ s4 offset, absOffset;
+ u4 targ;
assert(curOffset >= 0 && curOffset < insnCount);
/* make sure the start of the switch is in range */
- offsetToSwitch = (s2) insns[1];
+ offsetToSwitch = insns[1] | ((s4) insns[2]) << 16;
if (curOffset + offsetToSwitch < 0 ||
curOffset + offsetToSwitch + 2 >= insnCount)
{