1.3.0 javac generates invalid code with for loop + constructor call

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P2
    • None
    • Affects Version/s: 1.3.0
    • Component/s: tools
    • generic
    • generic



      Name: ssT124754 Date: 02/26/2001


      NT:
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      Solaris:
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
      Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)


      The following code will not compile under 1.2.2_05 but will under 1.3.0. With
      1.2.2_05, "Variable tb may not have been initialized." is reported in line 6.
      In 1.3.0 however, it compiles successfully but dies with a VerifyError when you
      try to run it. If the for loop is removed, or even replaced with a while loop,
      1.3.0 will also not compile it.

      import java.util.ArrayList;
      public class TestBug {
        public static void main (String[] args) {
          for (int i = 0; i < 2; i++) {}
          TestBug tb = new TestBug(tb);
        }
        public TestBug (TestBug tb) {}
      }
      (Review ID: 117695)
      ======================================================================

            Assignee:
            Neal Gafter (Inactive)
            Reporter:
            Shaheen Sultana (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: