Java: Add ConditionalExpr to overflow candidate pattern.

This commit is contained in:
Anders Schack-Mulligen
2019-11-12 17:27:18 +01:00
parent 39a45ceefe
commit 8cd6b51763
2 changed files with 10 additions and 0 deletions

View File

@@ -121,6 +121,11 @@ public class A {
}
}
void overflowTests2(int[] a, boolean b) {
int newlen = b ? (a.length + 1) << 1 : (a.length >> 1) + a.length;
if (newlen < 0) overflow();
}
static final long VAL = 100L;
long overflowAwareIncrease(long x) {