-
Bug
-
Resolution: Fixed
-
P2
-
1.0
-
1.0.2
-
x86
-
windows_nt
-
Verified
Steve Tuecke <###@###.###>
Compiler crashes with an exception in inlineLHS on assignment to Array.length field.
Steps to reproduce
Compile the attached source code
/* test */
public class Main1
{
public static void main(String argv[])
{
argv.length = 5;
}
}
---- Exception dump ----
java.lang.NullPointerException
at sun.tools.tree.FieldExpression.inlineLHS(FieldExpression.java:317)
at sun.tools.tree.BinaryAssignExpression.inlineValue(BinaryAssignExpression.java:62)
at sun.tools.tree.BinaryAssignExpression.inline(BinaryAssignExpression.java:59)
at sun.tools.tree.ExpressionStatement.inline(ExpressionStatement.java:51)
at sun.tools.tree.CompoundStatement.inline(CompoundStatement.java:65)
at sun.tools.javac.SourceField.inline(SourceField.java:293)
at sun.tools.javac.SourceField.code(SourceField.java:367)
at sun.tools.javac.SourceClass.compileClass(SourceClass.java:564)
at sun.tools.javac.SourceClass.compile(SourceClass.java:527)
at sun.tools.javac.Main.compile(Main.java:193)
at sun.tools.javac.Main.main(Main.java:289)
error: An exception has occurred in the compiler; please file a bug report (###@###.###).
1 error
Compiler crashes with an exception in inlineLHS on assignment to Array.length field.
Steps to reproduce
Compile the attached source code
/* test */
public class Main1
{
public static void main(String argv[])
{
argv.length = 5;
}
}
---- Exception dump ----
java.lang.NullPointerException
at sun.tools.tree.FieldExpression.inlineLHS(FieldExpression.java:317)
at sun.tools.tree.BinaryAssignExpression.inlineValue(BinaryAssignExpression.java:62)
at sun.tools.tree.BinaryAssignExpression.inline(BinaryAssignExpression.java:59)
at sun.tools.tree.ExpressionStatement.inline(ExpressionStatement.java:51)
at sun.tools.tree.CompoundStatement.inline(CompoundStatement.java:65)
at sun.tools.javac.SourceField.inline(SourceField.java:293)
at sun.tools.javac.SourceField.code(SourceField.java:367)
at sun.tools.javac.SourceClass.compileClass(SourceClass.java:564)
at sun.tools.javac.SourceClass.compile(SourceClass.java:527)
at sun.tools.javac.Main.compile(Main.java:193)
at sun.tools.javac.Main.main(Main.java:289)
error: An exception has occurred in the compiler; please file a bug report (###@###.###).
1 error
- relates to
-
JDK-4008246 regression: 1234786 - Invalid LHS of argument throws NullPointer
- Closed