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

compile-time constants not used correctly for 'unreachable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1
    • tools
    • None
    • x86
    • windows_95



      Name: mc57594 Date: 02/21/97


      A statement that is correctly diagnosed as unreachable (e.g.
      below) because it follows a while loop (or similar construct) whose boolean
      expression is the literal 'true' is not correctly diagnosed when the
      expression is another constant expression of value true.

      class B {
      {
      do
      ;
      while (true ? true : false); // never terminates
      System.out.println("hello, world!"); // unreachable
      }
      }

      I haven't checked the use of compile-time constants in other
      contexts, i.e. I don't know whether the fault lies with the determination
      of compile-time constants or the algorithm for diagnosing unreachable
      statements.
      ======================================================================

            dstoutamsunw David Stoutamire (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: