C++: only use upperbound if there are no overflows in the guard

This commit is contained in:
Anders Fugmann
2021-09-24 11:46:58 +02:00
parent d7afd86a27
commit 3437cf2909

View File

@@ -1549,7 +1549,8 @@ private float getGuardedUpperBound(VariableAccess guardedAccess) {
// that there is one predecessor, albeit somewhat conservative.
exists(unique(BasicBlock b | b = def.(BasicBlock).getAPredecessor())) and
guardedAccess = def.getAUse(v) and
result = max(float ub | upperBoundFromGuard(guard, guardVa, ub, branch))
result = max(float ub | upperBoundFromGuard(guard, guardVa, ub, branch)) and
not exists(Expr e | e = guard.getAChild+() | convertedExprMightOverflow(e))
)
}