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

1.3.0 javac generates invalid code with for loop + constructor call

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2
    • None
    • 1.3.0
    • tools
    • generic
    • generic

    Description



      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)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: