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.
======================================================================
- duplicates
-
JDK-4240486 dasg03[4-5]02m011.html: bad bytecodes generated - inconsistent stack height
- Closed