| commit | 6e957943e2abe5d8779848e7e3b2cc6582fce919 | [log] [tgz] |
|---|---|---|
| author | Clément Béra <clementbera@google.com> | Tue May 02 14:14:23 2023 +0200 |
| committer | Clément Béra <clementbera@google.com> | Tue May 02 14:14:23 2023 +0200 |
| tree | 89f5fa49487ed0d391f71c57d751e298c651a6c3 | |
| parent | 4303e275ff5cd7f4ba8c386ae06f7cb69dd1edd4 [diff] |
Fix enum unboxer keep rule updates Change-Id: Ia69fd71e83ecd701ae78d25538a4e8a0e9227677
diff --git a/src/main/java/com/android/tools/r8/shaking/KeepInfoCollection.java b/src/main/java/com/android/tools/r8/shaking/KeepInfoCollection.java index 9491483..03104f6 100644 --- a/src/main/java/com/android/tools/r8/shaking/KeepInfoCollection.java +++ b/src/main/java/com/android/tools/r8/shaking/KeepInfoCollection.java
@@ -317,6 +317,11 @@ keepClassInfo.forEach( (type, info) -> { DexType newType = lens.lookupType(type); + if (newType == options.dexItemFactory().intType) { + // If the enum has been unboxed, then the keep info is no longer valid. This + // typically happens for conditional keep rules such as -keepclassmembers. + return; + } assert newType == type || !info.isPinned(options) || info.isMinificationAllowed(options)