Community
Participate
Working Groups
To reproduce the bug, compile the following class (compliance level 1.6) and run its main method with java -XX:-FailOverToOldVerifier StackMapBug public class StackMapBug { private static void dummy(Class<?> c, int n) { } public static void main(String... args) { dummy(Integer.class, (args == null ? -1 : 1)); } } The JVM (JDK 1.6.0_10, Win32) exits with Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 10 in method StackMapBug.main([Ljava/lang/String;)V at offset 3 In the two stackmap frames for the main method, the type of the first stack item is specified as java/lang/Integer (instead of java/lang/Class). Here is a part of the javap output for the example class: StackMapTable: number_of_entries = 2 frame_type = 74 /* same_locals_1_stack_item */ stack = [ class java/lang/Integer ] frame_type = 255 /* full_frame */ offset_delta = 0 locals = [ class "[Ljava/lang/String;" ] stack = [ class java/lang/Integer, int ]
This does not belong in the tools cross-project component. Is this an Eclipse JDT issue? Resolving as NOT_ECLIPSE, Ulf will need to reopen on the right spot.
I'm sorry about that error. It *is* a JDT issue.
Created attachment 133366 [details] Proposed fix
Trivial fix. I'll add a regression test for it.
Created attachment 133367 [details] Proposed fix + regression test Same patch with corresponding regression test.
Released for 3.5M7. Regression test added in org.eclipse.jdt.core.tests.compiler.regression.StackMapAttributeTest#test042
Verified for 3.5M7 using build I20090428-0100