Bug 32909

Summary: compiler error
Product: [Eclipse Project] JDT Reporter: Frank Buss <fb>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: jaeger
Version: 2.1   
Target Milestone: 2.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Frank Buss CLA 2003-02-25 05:23:58 EST
The following code:

int a = 0;
int b = 0;
if (a > 0 && b > 0 || true) {
	System.out.println("true");
} else {
	System.out.println("false");
}
System.out.println("end");

outputs only "end".
Comment 1 Philipe Mulet CLA 2003-02-25 05:43:43 EST
Reproduced. Seems like a codegen optimization bug.
Comment 2 Philipe Mulet CLA 2003-02-25 06:58:20 EST
When generating code for ((x && y) || true), (x && y) was allowed to branch to 
falseLabel, even though it is evaluation to a true condition in the end. Use an 
internal falseLabel to trap this scenario (as we do in standard cases to chain 
boolean expressions).

Fixed in latest, ((x || y)&& false)  had similar bug. Regression tests added.
Comment 3 David Audel CLA 2003-03-10 11:26:50 EST
Verified.