Integrated: 8219810: javac throws NullPointerException

Archie L. Cobbs duke at openjdk.org
Wed Jan 4 17:53:58 UTC 2023


On Fri, 21 Oct 2022 22:30:27 GMT, Archie L. Cobbs <duke at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: 44be5edf
Author:    Archie L. Cobbs <archie.cobbs at gmail.com>
Committer: Vicente Romero <vromero at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/44be5edf5aa661169c665aa9386e5930a3632524
Stats:     194 lines in 9 files changed: 192 ins; 0 del; 2 mod

8219810: javac throws NullPointerException

Reviewed-by: vromero

-------------

PR: https://git.openjdk.org/jdk/pull/10826


More information about the compiler-dev mailing list