Bug 40495 - VerifyError with return statements containing a cast expression
Summary: VerifyError with return statements containing a cast expression
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P1 blocker (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-18 14:36 EDT by Olivier Thomann CLA
Modified: 2003-07-18 17:31 EDT (History)
0 users

See Also:


Attachments

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