@Override public void returnOperation(final AbstractInsnNode insn, final BasicValue value, final BasicValue expected) throws AnalyzerException { if (!isSubTypeOf(value, expected)) { throw new AnalyzerException(insn, "Incompatible return type", expected, value); } }
if (opcode != INVOKESTATIC && opcode != INVOKEDYNAMIC) { Type owner = Type.getObjectType(((MethodInsnNode) insn).owner); if (!isSubTypeOf(values.get(i++), newValue(owner))) { throw new AnalyzerException(insn, "Method owner", newValue(owner), values.get(0)); BasicValue expected = newValue(args[j++]); BasicValue encountered = values.get(i++); if (!isSubTypeOf(encountered, expected)) { throw new AnalyzerException(insn, "Argument " + j, expected, encountered);
break; case BASTORE: if (isSubTypeOf(value1, newValue(Type.getType("[Z")))) { expected1 = newValue(Type.getType("[Z")); } else { throw new Error("Internal error."); if (!isSubTypeOf(value1, expected1)) { throw new AnalyzerException(insn, "First argument", "a " + expected1 + " array reference", value1); throw new AnalyzerException(insn, "Second argument", BasicValue.INT_VALUE, value2); } else if (!isSubTypeOf(value3, expected3)) { throw new AnalyzerException(insn, "Third argument", expected3, value3);
break; case BALOAD: if (isSubTypeOf(value1, newValue(Type.getType("[Z")))) { expected1 = newValue(Type.getType("[Z")); } else { throw new Error("Internal error."); if (!isSubTypeOf(value1, expected1)) { throw new AnalyzerException(insn, "First argument", expected1, value1); } else if (!isSubTypeOf(value2, expected2)) { throw new AnalyzerException(insn, "Second argument", expected2, value2);
throw new Error("Internal error."); if (!isSubTypeOf(value, expected)) { throw new AnalyzerException(insn, null, expected, value);