RFR: 8219810: javac throws NullPointerException [v3]
Archie L. Cobbs
duke at openjdk.org
Mon Dec 19 15:44:57 UTC 2022
> JVMS 4.5 states:
>
>> Each field of a class may have at most one of its ACC_PUBLIC, ACC_PRIVATE, and ACC_PROTECTED flags set (JLS §8.3.1), and must not have both its ACC_FINAL and ACC_VOLATILE flags set (JLS §8.3.1.4).
>
> and JVMS 4.6 states:
>
>> Each method of a class may have at most one of its ACC_PUBLIC, ACC_PRIVATE, and ACC_PROTECTED flags set (JLS §8.4.3).
>
> However, when reading class files these illegal combinations are not actually checked, and this can lead to compiler crashes as in the bug example.
>
> This patch adds checks for these illegal combinations.
Archie L. Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
- Merge branch 'master' into JDK-8219810
- Merge branch 'master' into JDK-8219810
- Also disallow field access flags from having both FINAL and VOLATILE.
- Detect invalid access flag combinations for fields and methods in classfiles.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/10826/files
- new: https://git.openjdk.org/jdk/pull/10826/files/b2667d90..94cb9924
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=10826&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=10826&range=01-02
Stats: 136482 lines in 2312 files changed: 69468 ins; 45399 del; 21615 mod
Patch: https://git.openjdk.org/jdk/pull/10826.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10826/head:pull/10826
PR: https://git.openjdk.org/jdk/pull/10826
More information about the compiler-dev
mailing list