Lines Matching full:meth
26 static bool verifyMethod(Method* meth, int verifyFlags);
27 static bool verifyInstructions(const Method* meth, InsnFlags* insnFlags,
175 static bool verifyMethod(Method* meth, int verifyFlags)
184 * exit successfully. Note: meth->insns gets set to a native function
187 if (dvmGetMethodInsnsSize(meth) == 0) {
188 if (!dvmIsNativeMethod(meth) && !dvmIsAbstractMethod(meth)) {
189 LOG_VFY_METH(meth,
201 if (meth->insSize > meth->registersSize) {
202 LOG_VFY_METH(meth, "VFY: bad register counts (ins=%d regs=%d)\n",
203 meth->insSize, meth->registersSize);
214 calloc(dvmGetMethodInsnsSize(meth), sizeof(InsnFlags));
223 if (!dvmComputeCodeWidths(meth, insnFlags, &newInstanceCount))
229 uninitMap = dvmCreateUninitInstanceMap(meth, insnFlags, newInstanceCount);
236 if (!dvmSetTryFlags(meth, insnFlags))
242 if (!verifyInstructions(meth, insnFlags, verifyFlags))
253 if (!dvmVerifyCodeFlow(meth, insnFlags, uninitMap)) {
254 //LOGD("+++ %s failed code flow\n", meth->name);
272 static bool checkArrayData(const Method* meth, int curOffset)
274 const int insnCount = dvmGetMethodInsnsSize(meth);
275 const u2* insns = meth->insns + curOffset;
287 LOG_VFY_METH(meth,
298 LOG_VFY_METH(meth,
311 LOG_VFY_METH(meth,
327 static void decodeInstruction(const Method* meth, int insnIdx,
330 dexDecodeInstruction(gDvm.instrFormat, meth->insns + insnIdx, pDecInsn);
340 static bool checkNewInstance(const Method* meth, int insnIdx)
342 DvmDex* pDvmDex = meth->clazz->pDvmDex;
347 decodeInstruction(meth, insnIdx, &decInsn);
350 LOG_VFY_METH(meth, "VFY: bad type index %d (max %d)\n",
357 LOG_VFY_METH(meth, "VFY: can't call new-instance on type '%s'\n",
370 static bool checkNewArray(const Method* meth, int insnIdx)
372 DvmDex* pDvmDex = meth->clazz->pDvmDex;
377 decodeInstruction(meth, insnIdx, &decInsn);
380 LOG_VFY_METH(meth, "VFY: bad type index %d (max %d)\n",
394 LOG_VFY_METH(meth, "VFY: can't new-array class '%s' (not an array)\n",
399 LOG_VFY_METH(meth, "VFY: can't new-array class '%s' (exceeds limit)\n",
411 static bool checkTypeIndex(const Method* meth, int insnIdx, bool useB)
413 DvmDex* pDvmDex = meth->clazz->pDvmDex;
417 decodeInstruction(meth, insnIdx, &decInsn);
423 LOG_VFY_METH(meth, "VFY: bad type index %d (max %d)\n",
435 static bool checkFieldIndex(const Method* meth, int insnIdx, bool useB)
437 DvmDex* pDvmDex = meth->clazz->pDvmDex;
441 decodeInstruction(meth, insnIdx, &decInsn);
447 LOG_VFY_METH(meth,
460 static bool checkMethodIndex(const Method* meth, int insnIdx)
462 DvmDex* pDvmDex = meth->clazz->pDvmDex;
465 decodeInstruction(meth, insnIdx, &decInsn);
467 LOG_VFY_METH(meth, "VFY: bad method index %d (max %d)\n",
479 static bool checkStringIndex(const Method* meth, int insnIdx)
481 DvmDex* pDvmDex = meth->clazz->pDvmDex;
484 decodeInstruction(meth, insnIdx, &decInsn);
486 LOG_VFY_METH(meth, "VFY: bad string index %d (max %d)\n",
533 static bool verifyInstructions(const Method* meth, InsnFlags* insnFlags,
536 const int insnCount = dvmGetMethodInsnsSize(meth);
537 const u2* insns = meth->insns;
565 if (dvmGetBranchTarget(meth, insnFlags, i, &offset, &unused)) {
582 if (!checkStringIndex(meth, i))
588 if (!checkTypeIndex(meth, i, true))
592 if (!checkTypeIndex(meth, i, false))
599 if (!dvmCheckSwitchTargets(meth, insnFlags, i))
605 if (!checkArrayData(meth, i))
624 if (!dvmCheckBranchTarget(meth, insnFlags, i, false))
629 if (!dvmCheckBranchTarget(meth, insnFlags, i, true))
634 if (!checkNewInstance(meth, i))
639 if (!checkNewArray(meth, i))
644 if (!checkTypeIndex(meth, i, true))
648 if (!checkTypeIndex(meth, i, true))
667 if (!checkFieldIndex(meth, i, false))
685 if (!checkFieldIndex(meth, i, true))
700 if (!checkMethodIndex(meth, i))
734 LOG_VFY_METH(meth,