Bug 40495

Summary: VerifyError with return statements containing a cast expression
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: blocker    
Priority: P1    
Version: 3.0   
Target Milestone: 3.0 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Olivier Thomann CLA 2003-07-18 14:36:43 EDT
Using 0717 (M2 build), the following test case leads to a VerifyError at runtime.
public class Test {
	boolean value;
	
	public static void main(String[] args) {
		System.out.println(new Test().booleanValue());
	}
	
	public boolean booleanValue() {
		return (boolean) value;
	}
}

The problem is a collision in the bits used on the cast expression. We are
working on a fix.
Comment 1 Olivier Thomann CLA 2003-07-18 14:37:00 EDT
Change milestone.
Comment 2 Olivier Thomann CLA 2003-07-18 14:45:40 EDT
Fix is to change the bit for NeedRuntimeCheckMASK to bit16 instead of bit5.
Regression test added.
Comment 3 Philipe Mulet CLA 2003-07-18 15:05:07 EDT
This problem arised when building a 2.1.1 jdt.core with 3.0-20030717 build. 
This code pattern is legite, and actually present in jdt.core from 2.1.1 stream.

Without this fix, the compiler is fairly corrupted, due to a bit collision.
Comment 4 Philipe Mulet CLA 2003-07-18 15:07:09 EDT
Curiously, neither JCK1.3a, JCK1.4, Jacks or our test suites did catch this 
scenario.
Comment 5 Olivier Thomann CLA 2003-07-18 15:28:54 EDT
Fixed and released in HEAD.
Regression test added (ConformTests.test232).
Comment 6 Olivier Thomann CLA 2003-07-18 17:31:44 EDT
Verified.