Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8028826 | port-stage-ppc-aix | Vicente Arturo Romero Zaldivar | P2 | Resolved | Fixed | master |
Description
if the following code is compiled with -g:
public class Test2 {
protected int getLineNumberWidth() {
int newWidth = 0;
String tc = "b";
if (tc != null) {
String fm;
if (tc.trim() != null) {
} else if ((fm = "b") != null) {
newWidth += fm.length();
}
}
return newWidth;
}
}
you get:
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:1190)
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:755)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1554)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1518)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:910)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:869)
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)
(problem discovered by Jan Lahoda)
public class Test2 {
protected int getLineNumberWidth() {
int newWidth = 0;
String tc = "b";
if (tc != null) {
String fm;
if (tc.trim() != null) {
} else if ((fm = "b") != null) {
newWidth += fm.length();
}
}
return newWidth;
}
}
you get:
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:1190)
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:755)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1554)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1518)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:910)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:869)
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)
(problem discovered by Jan Lahoda)
Attachments
Issue Links
- backported by
-
JDK-8028826 javac crash while creating LVT entry for a local variable defined in an inner block
- Resolved