Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0cd6941

Browse files
author
Robert Marsh
committed
C++: Filter out lower bounds on overflowing exprs
Fixes performance issues where multiple lower bounds would be computed for overflowing expressions
1 parent 9b07782 commit 0cd6941

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cpp/ql/src/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,8 @@ private float getTruncatedLowerBounds(Expr expr) {
625625
)
626626
else result = newLB
627627
else result = exprMinVal(expr)
628-
)
628+
) and
629+
getUpperBoundsImpl(expr) <= exprMaxVal(expr)
629630
or
630631
// The expression might overflow and wrap. If so, the
631632
// lower bound is exprMinVal.

0 commit comments

Comments
 (0)