Integrated: 8322159: ThisEscapeAnalyzer crashes for erroneous code

Jan Lahoda jlahoda at openjdk.org
Tue Jan 2 11:17:53 UTC 2024


On Fri, 15 Dec 2023 08:10:42 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> When an unresolvable method is used in the code, the model is a bit strange (and not very easy to fix) - for method invocations, the symbol used is actually a `ClassSymbol` instead of `MethodSymbol`, and method references have fields like `kind` unfilled.
> 
> This is causing issues in ThisEscapeAnalyzer when there were unresolvable methods, and the analyzer is called (i.e. in practice when running with `-Xlint:this-escape -XDshould-stop.at=FLOW`, or similar):
>  - `visitApply` has a hardcoded cast to `MethodSymbol`. Seems the case in not really necessary, so the proposal is to remove it.
>  - `visitReference` crashes on an access to `JCMemberReference.kind`, as it is unfilled. The proposal is to skip the check if the method reference's type is errneous.

This pull request has now been integrated.

Changeset: 7455b1b5
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/7455b1b527568aff5b1c16a29fd80b05260c0fad
Stats:     44 lines in 2 files changed: 41 ins; 0 del; 3 mod

8322159: ThisEscapeAnalyzer crashes for erroneous code

Reviewed-by: vromero

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

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


More information about the compiler-dev mailing list