Bug 32909 - compiler error
Summary: compiler error
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 2.1 RC2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-25 05:23 EST by Frank Buss CLA
Modified: 2003-03-10 11:26 EST (History)
1 user (show)

See Also:


Attachments

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