Bug 78464 - [1.5][compiler] bad args_size attribute value for Enum constructor
Summary: [1.5][compiler] bad args_size attribute value for Enum constructor
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-11 19:21 EST by Luc Bourlier CLA
Modified: 2004-12-14 15:55 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luc Bourlier CLA 2004-11-11 19:21:04 EST
jdt.core from HEAD

From the tests I performed, it looks like the value set for args_size for the
enumeration constructor is always 1 more that what it should be.
It doesn't seems to be a real problem most of the time, but the VM complains
(loudly) when the stack size is less than the args size.

public enum TestEnum {
  a(1);
  TestEnum(int i) {
  }
}

In this case, args_size is set to 4, it should be 3 (1 specified arg + 2 'magic'
ones). Sun 1.5 VM throws an ClassFormatError when you try to load this class.
Comment 1 Philipe Mulet CLA 2004-11-11 20:04:55 EST
Codestream forgot to consider enum constructor scenario when initializing maxLocals.

Added regression test: EnumTest#test046.
Fixed
Comment 2 Olivier Thomann CLA 2004-12-14 15:55:34 EST
Verified in 200412140800