| commit | 56b8ed525a302b776abc2d18ae05e94faec4c28c | [log] [tgz] |
|---|---|---|
| author | Christoffer Adamsen <christofferqa@google.com> | Tue May 21 09:51:04 2024 +0200 |
| committer | Christoffer Adamsen <christofferqa@google.com> | Tue May 21 09:51:04 2024 +0200 |
| tree | da1f501eb45cf5d3563c5398d3d3bcb3f43e7402 | |
| parent | 910880c875af1eda1d7601bb41645dcabe47e442 [diff] |
Account for virtual call to abstract method on effectively final class Bug: b/341537881 Change-Id: I8bf48a89d2e46caa37f6ea418694899db2aaeb81
diff --git a/src/main/java/com/android/tools/r8/horizontalclassmerging/policies/NoClassInitializerCycles.java b/src/main/java/com/android/tools/r8/horizontalclassmerging/policies/NoClassInitializerCycles.java index 9addf2f..ec45f9d 100644 --- a/src/main/java/com/android/tools/r8/horizontalclassmerging/policies/NoClassInitializerCycles.java +++ b/src/main/java/com/android/tools/r8/horizontalclassmerging/policies/NoClassInitializerCycles.java
@@ -551,12 +551,15 @@ .appInfo() .resolveMethodOnClassHolderLegacy(rewrittenMethod) .getResolutionPair(); - if (resolvedMethod != null) { - if (!resolvedMethod.getHolder().isEffectivelyFinal(appView)) { - fail(); - } else if (resolvedMethod.isProgramMethod()) { - enqueueMethod(resolvedMethod.asProgramMethod()); - } + if (resolvedMethod == null) { + return; + } + if (!resolvedMethod.getHolder().isEffectivelyFinal(appView)) { + fail(); + return; + } + if (resolvedMethod.isProgramMethod() && !resolvedMethod.getAccessFlags().isAbstract()) { + enqueueMethod(resolvedMethod.asProgramMethod()); } }