Integrated: 8334043: VerifyError when inner class is accessed in prologue

Archie Cobbs acobbs at openjdk.org
Tue Jun 18 08:45:24 UTC 2024


On Tue, 11 Jun 2024 21:10:37 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

> The new flexible constructors logic creates an exception to the normal rule preventing early access to `this` in an early construction context by allowing assignments to instance fields. The check for this exception is performed by `Resolve.isAllowedEarlyReference()`, but this method was incorrectlly assuming that the expression was simpler than it can sometimes be, for example, for more complicated assignment expressions like `this.new InnerClass().foo = 123`.
> 
> This change verifies that the expression actually looks like either `Y = Z` or `X.Y = Z` where `X` is a simple reference to the current class' `this` instance (i.e., `this`, or `ThisClass.this`).

This pull request has now been integrated.

Changeset: d4c13737
Author:    Archie Cobbs <acobbs at openjdk.org>
Committer: Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/d4c13737171b7ab7a8a29a69fa9965f8363c5aee
Stats:     27 lines in 3 files changed: 25 ins; 0 del; 2 mod

8334043: VerifyError when inner class is accessed in prologue

Reviewed-by: mcimadamore

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

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


More information about the compiler-dev mailing list