AssertionError during LVT generation with javac 8u20

Liam Miller-Cushon cushon at google.com
Wed Oct 8 18:03:28 UTC 2014


It looks like the fix for JDK-8037937 introduced a different LVT-related
AssertionError. The crash bisects down to
http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/rev/372fd7283bf0

Repro:

=== Test.java ===
public class Test {
  void m(Object[] xs) {
    {
      Object[] ys;
      int i;

      for (Object x : xs) {
      }

      if (xs != null) {
        i = 0;
      }
    }
  }
}
===

$ javac -g Test.java
An exception has occurred in the compiler (1.8.0_20). Please file a bug at
the Java Developer Connection (http://java.sun.com/webapps/bugreport)
 after checking the Bug Parade for duplicates. Include your program and the
following diagnostic in your report.  Thank you.
java.lang.AssertionError
at com.sun.tools.javac.util.Assert.error(Assert.java:126)
at com.sun.tools.javac.util.Assert.check(Assert.java:45)
at com.sun.tools.javac.jvm.ClassWriter.writeCode(ClassWriter.java:1189)
at com.sun.tools.javac.jvm.ClassWriter.writeMethod(ClassWriter.java:1110)
at com.sun.tools.javac.jvm.ClassWriter.writeMethods(ClassWriter.java:1602)
at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1692)
at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1620)
at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:746)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1572)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1536)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
at com.sun.tools.javac.main.Main.compile(Main.java:381)
at com.sun.tools.javac.main.Main.compile(Main.java:370)
at com.sun.tools.javac.main.Main.compile(Main.java:361)
at com.sun.tools.javac.Main.compile(Main.java:56)
at com.sun.tools.javac.Main.main(Main.java:42)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20141008/0a5d4daf/attachment.html>


More information about the compiler-dev mailing list