Name: viR10068 Date: 11/13/2003
The JVM (1.5.0-beta-b28) rejects valid class files due
to control flow falls through code end while the prolog
spec accepts it.
The new JCK tests are failed due to this error:
vm/classfmt/vrf/vrfmef204/vrfmef20401m1t/vrfmef20401m1t.html
vm/classfmt/vrf/vrfmef204/vrfmef20402m1t/vrfmef20402m1t.html
vm/classfmt/vrf/vrfmef204/vrfmef20403m1t/vrfmef20403m1t.html
vm/classfmt/vrf/vrfmef204/vrfmef20404m1t/vrfmef20404m1t.html
The test source:
--------------------- test13.jasm ---------------------------
class test13 version 49:0 {
Method "<init>":"()V"
stack 1 locals 1
{
aload_0;
invokespecial Method java/lang/Object."<init>":"()V";
return;
}
Method getval:"(I)I"
stack 1 locals 2
{
iload_1;
ifne L6;
iconst_1;
istore_1;
L6:
locals_map class test13, int;
iload_1;
ireturn;
}
Method callPrc:"(Ljava/lang/String;)Ljava/lang/String;"
stack 2 locals 3
{
ldc String "hi";
astore_2;
aload_2;
aload_1;
if_acmpeq L11;
ldc String "qwe";
astore_2;
L11: locals_map class test13, class java/lang/String, class java/lang/String;
aload_2;
areturn;
}
Method ifGraph:"()I"
stack 9 locals 5
{
aload_0;
bipush 10;
invokevirtual Method getval:"(I)I";
istore_1;
Nod2: iload_1;
iconst_2;
if_icmpne L110;
aload_0;
ldc String "hi";
aload_0;
iload_1;
invokevirtual Method getval:"(I)I";
istore_1;
Nod6: iload_1;
bipush 6;
if_icmpne L38;
aload_0;
iload_1;
bipush 6;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod7: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L38: locals_map class test13, int;
stack_map class test13, class java/lang/String;
iload_1;
bipush 7;
if_icmpne L56;
aload_0;
iload_1;
bipush 7;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod8: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L56: locals_map class test13, int;
stack_map class test13, class java/lang/String;
iload_1;
bipush 8;
if_icmpne L74;
aload_0;
iload_1;
bipush 8;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod9: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L74: locals_map class test13, int;
stack_map class test13, class java/lang/String;
iload_1;
bipush 9;
if_icmpne L92;
aload_0;
iload_1;
bipush 9;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod10: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L92: locals_map class test13, int;
stack_map class test13, class java/lang/String;
aload_0;
iload_1;
bipush 10;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod3: locals_map class test13, int;
nop;
L110: locals_map class test13, int;
iload_1;
iconst_3;
if_icmpne L207;
aload_0;
ldc String "hi";
aload_0;
iload_1;
invokevirtual Method getval:"(I)I";
istore_1;
iload_1;
bipush 101;
if_icmpne L141;
aload_0;
iload_1;
bipush 101;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto Nod10; // add goto
Nod11: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L141: locals_map class test13, int;
stack_map class test13, class java/lang/String;
iload_1;
bipush 11;
if_icmpne L159;
aload_0;
iload_1;
bipush 11;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod12: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L159: locals_map class test13, int;
stack_map class test13, class java/lang/String;
iload_1;
bipush 12;
if_icmpne L177;
aload_0;
iload_1;
bipush 12;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod13: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L177: locals_map class test13, int;
stack_map class test13, class java/lang/String;
iload_1;
bipush 13;
if_icmpne L195;
aload_0;
iload_1;
bipush 13;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod14: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L195: locals_map class test13, int;
stack_map class test13, class java/lang/String;
aload_0;
iload_1;
bipush 14;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod4: locals_map class test13, int;
nop;
L207: locals_map class test13, int;
iload_1;
iconst_4;
if_icmpne L338;
aload_0;
iload_1;
invokevirtual Method getval:"(I)I";
istore_1;
iload_1;
sipush 131;
if_icmpne L246;
aload_0;
iload_1;
sipush 131;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
aload_0;
ldc String "hi";
goto Nod13; // add goto
L246: locals_map class test13, int;
iload_1;
sipush 141;
if_icmpne L274;
aload_0;
iload_1;
sipush 141;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
aload_0;
ldc String "hi";
goto Nod14; // add goto
Nod15: locals_map class test13, int;
nop;
L274: locals_map class test13, int;
iload_1;
bipush 15;
if_icmpne L292;
aload_0;
iload_1;
bipush 15;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
aload_0;
ldc String "hi";
/* wrong:
goto ERROR;
locals_map class test13, int;
stack_map class test13, class java/lang/String;
end wrong */
goto L417;
Nod16: locals_map class test13, int;
nop;
L292: locals_map class test13, int;
iload_1;
bipush 16;
if_icmpne L318;
aload_0;
iload_1;
bipush 16;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
aload_0;
ldc String "hi";
goto L417;
Nod17: locals_map class test13, int;
nop;
L318: locals_map class test13, int;
aload_0;
iload_1;
bipush 17;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
aload_0;
ldc String "hi";
goto L417;
Nod5: locals_map class test13, int;
nop;
L338: locals_map class test13, int;
aload_0;
ldc String "hi";
aload_0;
iload_1;
iconst_5;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
iload_1;
sipush 171;
if_icmpne L368;
aload_0;
iload_1;
sipush 171;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
pop;
pop;
goto Nod17; // add goto
Nod18: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L368: locals_map class test13, int;
stack_map class test13, class java/lang/String;
iload_1;
bipush 18;
if_icmpne L386;
aload_0;
iload_1;
bipush 18;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod19: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L386: locals_map class test13, int;
stack_map class test13, class java/lang/String;
iload_1;
bipush 19;
if_icmpne L397;
goto L417;
Nod20: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L397: locals_map class test13, int;
stack_map class test13, class java/lang/String;
iload_1;
bipush 20;
if_icmpne L415;
aload_0;
iload_1;
bipush 20;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
goto L417;
Nod21: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L415: locals_map class test13, int;
stack_map class test13, class java/lang/String;
nop;
L417: locals_map class test13, int;
stack_map class test13, class java/lang/String;
invokevirtual Method
callPrc:"(Ljava/lang/String;)Ljava/lang/String;";
astore_2;
aload_0;
iload_1;
invokevirtual Method getval:"(I)I";
ireturn;
ERROR:
locals_map class test13, int;
stack_map class test13, class java/lang/String;
aload_0;
iload_1;
bipush 66;
iadd;
invokevirtual Method getval:"(I)I";
istore_1;
}
}
-------------------------------------------------------------
The execution log:
% jasm test13.jasm && jdk1.5.0-b28/solaris-sparc/bin/java -showversion -Xfuture test13
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b28)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b28, mixed mode)
Exception in thread "main" java.lang.VerifyError: Control flow falls through code end in
method test13.ifGraph()I
%
======================================================================