Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 409247

Summary: [1.8][compiler] Verify error with code allocating multidimensional array.
Product: [Eclipse Project] JDT Reporter: Srikanth Sankaran <srikanth_sankaran>
Component: CoreAssignee: Andrew Clement <aclement>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, srikanth_sankaran
Version: 4.3Flags: srikanth_sankaran: review+
Target Milestone: BETA J8   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 409235    
Attachments:
Description Flags
Patch that adds testcase and implements fix none

Description Srikanth Sankaran CLA 2013-05-28 04:09:05 EDT
BETA_JAVA8:

The following program triggers a verify error when run (operand stack underflow)

// ---
public class X {
	public static void main(String[] args) {
		X [][][] x = new X[10][10][];  
	}
}
Comment 1 Srikanth Sankaran CLA 2013-05-28 04:09:40 EDT
Andy, thanks for following up.
Comment 2 Andrew Clement CLA 2013-05-30 10:48:26 EDT
Created attachment 231752 [details]
Patch that adds testcase and implements fix

The problem here was a switch in the typo anno generation code to using declared dimensions on the call to multianewarray rather than the explicitly specified dimensions.  Part of the code gen needs the explicit information whilst the type annotation generation code needs the declared dimensions. The fix is to pass both.
Comment 3 Srikanth Sankaran CLA 2013-08-05 04:36:37 EDT
Patch looks good. Andy please sign off.

Jay, thanks for releasing and resolving this one too.
Comment 4 Andrew Clement CLA 2013-08-06 12:42:17 EDT
This contribution complies with http://www.eclipse.org/legal/CoO.php
Comment 6 Srikanth Sankaran CLA 2013-08-20 08:03:25 EDT
*** Bug 415312 has been marked as a duplicate of this bug. ***