RFR: 7194212: NPE in Flow.visitIdent [v2]
Jan Lahoda
jlahoda at openjdk.org
Tue Aug 9 09:37:14 UTC 2022
> A somewhat corner-case issue, but consider a case where classfiles for:
>
>
> public class Outer {
> public class Inner { }
> }
>
>
> Are on a classpath while compiling:
>
>
> public class Outer$Inner extends Outer { }
>
>
> This leads to a crash in javac (in Flow), because when Outer is completed, its InnerClasses attribute is read, and, based on it, the flags_field of Outer$Inner is (re)set (and it is put as an nested class to Outer, although that is not correct). But the flags_field used to contain UNATTRIBUTED flag. As this flag is cleared, the method bodies for Outer$Inner are never attributed (its default constructor in this case), which ultimately leads to the crash in Flow.
>
> The proposed patch is to ensure the InnerClasses entry is ignored if we are compiling a same-named class from source. The cost is yet another Flag bit.
Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits:
- Fixing years.
- Adding comment.
- Fixing test.
- Merge branch 'master' into JDK-7194212
- Fixing FlagsTest.
- 7194212: NPE in Flow.visitIdent
-------------
Changes: https://git.openjdk.org/jdk/pull/1326/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=1326&range=01
Stats: 120 lines in 6 files changed: 110 ins; 1 del; 9 mod
Patch: https://git.openjdk.org/jdk/pull/1326.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/1326/head:pull/1326
PR: https://git.openjdk.org/jdk/pull/1326
More information about the compiler-dev
mailing list