Skip to content

Fix inner class access flags - #20

Merged
piazzesiNiccolo-GS merged 1 commit into
Guardsquare:masterfrom
mrjameshamilton:jhamilton/fix-inner-class-flags
Jan 30, 2026
Merged

Fix inner class access flags#20
piazzesiNiccolo-GS merged 1 commit into
Guardsquare:masterfrom
mrjameshamilton:jhamilton/fix-inner-class-flags

Conversation

@mrjameshamilton

Copy link
Copy Markdown
Contributor

The inner class access flags are currently parsed using the expectClassAccessFlags method which parses the class access flags. The set of access flags allowed on the inner class is smaller than the class access flags (see https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.6-300-D.2-5).

In particular, the ACC_SUPER should not appear. JVMs appear to ignore this but stricter tools like ASM's CheckClassAdapter fail as the flags are invalid.

The error can be reproduced in the following small sample program that creates a Inner class file using the current ProGuard assembler release (1.0.0) and then tries to use the CheckClassAdapter from ASM on this class:

$ mvn compile
$ mvn exec:java -Dexec.mainClass="CreateBadClass"
...
Created BadOuter.class using proguard-assembler
Validation failed: Invalid access flags: 33

inner-class-validator.zip

@mrjameshamilton
mrjameshamilton force-pushed the jhamilton/fix-inner-class-flags branch from c2a4699 to 4bb4087 Compare January 29, 2026 18:22
Comment thread pga-lib/src/test/kotlin/com/guardsquare/proguard/InnerClassAccessFlagsTest.kt Outdated
@mrjameshamilton
mrjameshamilton force-pushed the jhamilton/fix-inner-class-flags branch from 4bb4087 to 356be62 Compare January 30, 2026 10:43
@piazzesiNiccolo-GS

Copy link
Copy Markdown

Thanks for the repro sample, verified it fixes it 🎉

@piazzesiNiccolo-GS
piazzesiNiccolo-GS merged commit 36da850 into Guardsquare:master Jan 30, 2026
1 check passed
@mrjameshamilton
mrjameshamilton deleted the jhamilton/fix-inner-class-flags branch January 30, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants