Community
Participate
Working Groups
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".
Reproduced. Seems like a codegen optimization bug.
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.
Verified.