crash in flow analysis

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Oct 21 13:02:01 UTC 2016


Thanks for the pointer. I've created this:

https://bugs.openjdk.java.net/browse/JDK-8168480

Maurizio


On 21/10/16 03:57, Liam Miller-Cushon wrote:
> The following snippet crashes javac 9ea+140. Is this a known issue?
>
> The tree is copied a couple of times during speculative attribution, 
> and the break target isn't getting set for one of the copies.
>
> abstract class Test {
>   abstract void f(Runnable r);
>
>   private void g() {
>     f(
>         () ->
>             new Runnable() {
>               public void run() {
>                 switch (42) {
>                   default:
>                     break;
>                 }
>               }
>             }.run());
>   }
> }
> ...
> java.lang.AssertionError
>         at 
> com.sun.tools.javac.util.Assert.error(jdk.compiler at 9-ea/Assert.java:155)
>         at 
> com.sun.tools.javac.util.Assert.check(jdk.compiler at 9-ea/Assert.java:46)
>         at 
> com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitMethodDef(jdk.compiler at 9-ea/Flow.java:524)
>         at 
> com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(jdk.compiler at 9-ea/JCTree.java:852)
>         at 
> com.sun.tools.javac.tree.TreeScanner.scan(jdk.compiler at 9-ea/TreeScanner.java:49)
>         at 
> com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(jdk.compiler at 9-ea/Flow.java:404)
>         at 
> com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitClassDef(jdk.compiler at 9-ea/Flow.java:494)
>         at 
> com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(jdk.compiler at 9-ea/JCTree.java:760)



More information about the compiler-dev mailing list