Bug 169596 - anewarray not propertly supported in 1.6
Summary: anewarray not propertly supported in 1.6
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 183682 185210 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-01-04 17:11 EST by Olivier Thomann CLA
Modified: 2007-05-07 11:18 EDT (History)
3 users (show)

See Also:


Attachments
Proposed fix (1.32 KB, patch)
2007-01-04 22:46 EST, Olivier Thomann CLA
no flags Details | Diff
Regression test (1.31 KB, patch)
2007-01-04 23:15 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***