Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1234786

fp.bugs 3193: Compiler crashes in inlineLHS on assignment to Array.length

XMLWordPrintable

    • 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

            fyellinsunw Frank Yellin (Inactive)
            kasmithsunw Kevin Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: