Bug 78464

Summary: [1.5][compiler] bad args_size attribute value for Enum constructor
Product: [Eclipse Project] JDT Reporter: Luc Bourlier <eclipse>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Linux   
Whiteboard:

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