Skip to content

Commit d422ea1

Browse files
committed
C++: Add number of bounds test to simple range analysis
1 parent 6d151cc commit d422ea1

File tree

3 files changed

+4580
-0
lines changed

3 files changed

+4580
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,4 +2140,7 @@ module SimpleRangeAnalysisInternal {
21402140
// bound is `typeUpperBound`.
21412141
defMightOverflowNegatively(def, v) and result = varMaxVal(v)
21422142
}
2143+
2144+
/** Gets the estimate of the number of bounds for `e`. */
2145+
float estimateNrOfBounds(Expr e) { result = BoundsEstimate::nrOfBoundsExpr(e) }
21432146
}

0 commit comments

Comments
 (0)