Fix graph lens context lookup
Change-Id: I2d3a2ab2123e7f30f40c6c1a779be001ec5b4e04
diff --git a/src/main/java/com/android/tools/r8/cf/code/CfInvoke.java b/src/main/java/com/android/tools/r8/cf/code/CfInvoke.java
index 3457111..4765be5 100644
--- a/src/main/java/com/android/tools/r8/cf/code/CfInvoke.java
+++ b/src/main/java/com/android/tools/r8/cf/code/CfInvoke.java
@@ -266,7 +266,7 @@
case Opcodes.INVOKESPECIAL:
if (appView.dexItemFactory().isConstructor(target)) {
type = Type.DIRECT;
- assert noNeedToUseGraphLens(target, type, graphLens);
+ assert noNeedToUseGraphLens(target, context.getReference(), type, graphLens);
} else if (target.holder == context.getHolderType()) {
// The method could have been publicized.
type = graphLens.lookupMethod(target, context.getReference(), Type.DIRECT).getType();
@@ -280,7 +280,7 @@
// TODO(christofferqa): Consider using graphLens.lookupMethod (to do this, we need the
// context for the graph lens, though).
type = Type.SUPER;
- assert noNeedToUseGraphLens(target, type, graphLens);
+ assert noNeedToUseGraphLens(target, context.getReference(), type, graphLens);
}
break;
@@ -344,8 +344,8 @@
}
private static boolean noNeedToUseGraphLens(
- DexMethod method, Invoke.Type type, GraphLens graphLens) {
- assert graphLens.lookupMethod(method, null, type).getType() == type;
+ DexMethod method, DexMethod context, Invoke.Type type, GraphLens graphLens) {
+ assert graphLens.lookupMethod(method, context, type).getType() == type;
return true;
}