-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
hopper
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2045621 | 1.4.0 | Neal Gafter | P3 | Closed | Fixed | beta3 |
Name: poR10007 Date: 07/23/2001
Javac (jdk1.4.0beta-b72) produces unverifiable code compiling the following
tests:
--Test1.java------------------------------------------------------
public class Test1 {
public static void main (String[] args) {
boolean b = true, c = false;
if ((b || true) ? c : !c) ;
}
}
------------------------------------------------------------------
--Test2.java------------------------------------------------------
public class Test2 {
public static void main (String[] args) {
boolean b = true, c = false;
if ((c && false) ? b : b) ;
}
}
------------------------------------------------------------------
--Execution log---------------------------------------------------
$ java -version
java version "1.4.0-beta_refresh"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta_refresh-b72)
Java HotSpot(TM) Client VM (build 1.4.0-beta_refresh-b72, mixed mode)
$ javac -d . Test1.java Test2.java; echo $?
0
$ java Test1; echo $?
Exception in thread "main" java.lang.VerifyError: (class: Test1, method: main signature: ([Ljava/lang/String;)V) Inconsistent stack
height 0 != 1
1
$ java Test2; echo $?
Exception in thread "main" java.lang.VerifyError: (class: Test2, method: main signature: ([Ljava/lang/String;)V) Inconsistent stack
height 0 != 1
1
$
------------------------------------------------------------------
The failure is reproducible since jdk1.4.0beta-b51.
======================================================================
- backported by
-
JDK-2045621 javac produces unverifiable classfile compiling conditional operator
- Closed
- relates to
-
JDK-4952629 REGRESSION: javac generates a spurious line number entry on } else {
- Resolved