Bug 169596

Summary: anewarray not propertly supported in 1.6
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david.liu, eclipse, philippe_mulet
Version: 3.3   
Target Milestone: 3.2.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix
none
Regression test none

Description Olivier Thomann CLA 2007-01-04 17:11:37 EST
This bytecode leads to invalid stack map frames.

Compile and run this test case in 1.6 mode:

public class X {
	public static void main(String[] args) {
	}
	
	void foo(Object[] o) {}

	void bar(boolean b) {
		foo(new Object[] {"", "", b ? "" : ""}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
	}
}

When running it with java -XX:-FailOverToOldVerifier -Xverify:all..., I get:
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack in method X.bar(Z)V at offset 28

This is trivially fixed.
Needs to be backported to 3.2.2
Comment 1 Olivier Thomann CLA 2007-01-04 22:46:53 EST
Created attachment 56443 [details]
Proposed fix
Comment 2 Olivier Thomann CLA 2007-01-04 23:15:12 EST
Created attachment 56444 [details]
Regression test
Comment 3 Olivier Thomann CLA 2007-01-04 23:33:33 EST
Released for 3.3M5.
Philippe,

Candidate for 3.2.2 ?
Comment 4 Philipe Mulet CLA 2007-01-08 06:15:27 EST
+1 for 3.2.2.
Comment 5 Olivier Thomann CLA 2007-01-08 12:15:19 EST
Released for 3.2.2.
Added regression test org.eclipse.jdt.core.tests.compiler.regression.StackMapAttributeTest#test024 for 3.2.2 and
org.eclipse.jdt.core.tests.compiler.regression.StackMapAttributeTest#test025 for 3.3M5
Comment 6 David Audel CLA 2007-01-16 04:39:43 EST
Verified for 3.2.2 using build M20070112-1200
Comment 7 Eric Jodet CLA 2007-02-06 03:10:02 EST
Verified for 3.3 M5 using build I20070205-0009
Comment 8 Olivier Thomann CLA 2007-04-23 20:44:44 EDT
*** Bug 183682 has been marked as a duplicate of this bug. ***
Comment 9 Olivier Thomann CLA 2007-04-23 20:45:59 EDT
*** Bug 183682 has been marked as a duplicate of this bug. ***
Comment 10 Olivier Thomann CLA 2007-05-07 11:18:00 EDT
*** Bug 185210 has been marked as a duplicate of this bug. ***