Java: Fix range analysis bug where int was assumed.

This commit is contained in:
Anders Schack-Mulligen
2019-11-15 15:08:14 +01:00
parent f813e06680
commit 81a90943c0
2 changed files with 22 additions and 4 deletions

View File

@@ -3,4 +3,12 @@ public class C {
return (x < 0 || x > 1 || Double.isNaN(x)) ? Double.NaN :
x == 0 ? 0 : x == 1 ? 1 : 0.5;
}
void m2(double x) {
if (x > 0) {
double y = 1 - x;
if (y > 0) { // OK
}
}
}
}