RFR: 8322159: ThisEscapeAnalyzer crashes for erroneous code
Vicente Romero
vromero at openjdk.org
Fri Dec 15 16:31:37 UTC 2023
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.
looks sensible
-------------
Marked as reviewed by vromero (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/17118#pullrequestreview-1784486330
More information about the compiler-dev
mailing list