Name: viR10068 Date: 11/13/2003
The JVM (1.5.0-beta-b28) accepts class v49:0 with non-zero
padding for tableswitch instruction.
Note, the JVM rejects this class file if CF version < 49:0.
The new JCK tests are failed due to this error:
vm/instr/tableswitch/tableswitch004/tableswitch00410m1t/tableswitch00410m1t.html
The test source:
--------------------- test11_49.jasm ---------------------------
public class test11_49 version 49:0 {
public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
stack 4 locals 3
{
iconst_0;
bytecode 170; // tableswitch
bytecode 0x80,0x00; // padding
bytecode 0,0,0,19; // default target == L16
bytecode 0,0,0,0;
bytecode 0,0,0,0;
bytecode 0,0,0,19;
L16: locals_map class "[Ljava/lang/String;", class java/io/PrintStream;
iconst_0;
ireturn;
}
}
--------------------- test11_45.jasm ---------------------------
public class test11_45 version 45:3 {
public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
stack 4 locals 3
{
iconst_0;
bytecode 170; // tableswitch
bytecode 0x80,0x00; // padding
bytecode 0,0,0,19; // default target == L16
bytecode 0,0,0,0;
bytecode 0,0,0,0;
bytecode 0,0,0,19;
L16: locals_map class "[Ljava/lang/String;", class java/io/PrintStream;
iconst_0;
ireturn;
}
}
----------------------------------------------------------------
The execution log:
% jdk1.5.0-b28/solaris-sparc/bin/java -showversion -Xfuture test11_49
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.NoSuchMethodError: main
% jdk1.5.0-b28/solaris-sparc/bin/java -showversion -Xfuture test11_45
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: (class: test11_45, method: run
signature: ([Lja
va/lang/String;Ljava/io/PrintStream;)I) Non zero padding bytes in switch
%
======================================================================