Community
Participate
Working Groups
The code generation for the class literal access should be extracted in a synthetic method. This would prevent a potential verification failure. The actual code generation doesn't flush properly the stack when entering in the catch block. This is visible with the cldc code since it requires stack maps to be generated.
Released in HEAD. Update existing regression tests. No need for a synthetic method. The fix was to improve the generation of the stack map frames.
I'm not sure how to verify this bug: what code was changed ? what tests were updated ?
Regression test added in org.eclipse.jdt.core.tests.compiler.regression.Compliance_CLDC#test002
An IBM VM 1.6 is required to verify the test case since the Sun VM doesn't detect the verify error.
To reproduce: 1. Start 3.4M2 on a new workspace 2. Create a Java project with CLDC1.1 as the Generated .class files compatibilty 3. Add the following class: public class X { public static void main(String[] args) { System.out.print(X.class != null); System.out.print(String.class != null); System.out.print(Object.class != null); System.out.print(X.class != null); } } 4. Run this class with an IBM 1.6 VM with the following argument: -Xverify:nofallback Observe: You get the following exception: Exception in thread "main" java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=X, method=main([Ljava/lang/String;)V, pc=10 at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:66) at java.lang.J9VMInternals.initialize(J9VMInternals.java:127) The verify error doesn't occur with 3.4M3. Verified for 3.4M3 using I20071029-0010