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

jck failure dasg03402m011 as new javac generates incorrect code

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description



      Name: ngC57085 Date: 06/25/99



      Java compiler jdk1.3H successfully compiles next JCK-122 test,
      checking definitely assigned variable after a ? b : c

      lang/DASG/dasg034/dasg03402m011/dasg03402m011.html

      but the execution of compiled class causes the java.lang.VerifyError.
      The reduced test source below.

      >java -version
      java version "1.3"
      Classic VM (build JDK-1.3-H, green threads, sunwjit)

      > javac -d . dasg03402m011.java
      > java javasoft.sqe.tests.lang.dasg034.dasg03402m011.dasg03402m011
      Exception in thread "main" java.lang.VerifyError: (class: javasoft/sqe/tests/lang/dasg034/dasg03402m011/dasg03402m011, method: run signature: ([Ljava/lang/String;Ljava/io/PrintStream;)I) Inconsistent stack height 0 != 1
      >

      The execution after oldjavac compilation is successful.

      > oldjavac -d . dasg03402m011.java
      > java javasoft.sqe.tests.lang.dasg034.dasg03402m011.dasg03402m011
      > echo $status
      95
      >

      -----------------dasg03402m011.java------------------
      package javasoft.sqe.tests.lang.dasg034.dasg03402m011;

      import java.io.PrintStream;

      public class dasg03402m011 {
      public static void main(String argv[]) {
      System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
      }

      public static int run(String argv[], PrintStream out) {
      boolean t = true, f = false;

      { boolean b1, r;
      if ( true || (b1 = t) ? true && (b1 = f) : f ) {
      r = b1;
      }
      }
      { boolean b1, r;
      if ( true || (b1 = t) ? true && (b1 = f) : false || (b1 = f) ) {
      r = b1;
      }
      }
      return 0/*STATUS_PASSED*/;
      }
      }
      ----------------------------------------------------


      ======================================================================

      Name: ngC57085 Date: 06/25/99


      The JCK-122 test lang/DASG/dasg035/dasg03502m011/dasg03502m011.html
      failed due the same reason.

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              iris Iris Clark
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: