Withdrawn: 8305007: Within-lambda subclass of local class using method param causes compiler crash

duke duke at openjdk.org
Tue Jun 18 04:44:15 UTC 2024


On Mon, 18 Dec 2023 23:38:26 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> javac is crashing while compiling code like:
> 
> 
> public abstract class CompilerCrashLambdaPlusLocalClass {
>     public abstract void consume(Runnable r);
> 
>     public void doThing(String parameter) {
>         class LocalClass {
>             @Override
>             public String toString() {
>                 return parameter;
>             }
>         }
>         consume(() -> {
>             class LambdaLocalClass extends LocalClass {}
>             new LocalClass();
>         });
>     }
> }
> 
> the reason for the issue is that the mappings for captured variables created by LambdaToMethod are not copying the `adr`, local address, field of the original VarSymbol it is mapping. Later on during code generation an assertion was being triggered due to a variable with an `adr < 0` this patch fixes this issue.
> 
> Thanks,
> Vicente

This pull request has been closed without being integrated.

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

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


More information about the compiler-dev mailing list