File tree Expand file tree Collapse file tree 3 files changed +5256
-5234
lines changed
lib/semmle/code/cpp/rangeanalysis
test/library-tests/rangeanalysis/SimpleRangeAnalysis Expand file tree Collapse file tree 3 files changed +5256
-5234
lines changed Original file line number Diff line number Diff line change @@ -2180,6 +2180,16 @@ module SimpleRangeAnalysisInternal {
21802180
21812181 /** Gets the estimate of the number of bounds for `e`. */
21822182 float estimateNrOfBounds ( Expr e ) { result = BoundsEstimate:: nrOfBoundsExpr ( e ) }
2183+
2184+ /** Counts the numbers of lower bounds that are computed internally for `e`. */
2185+ float countNrOfLowerBounds ( Expr e ) {
2186+ result = strictcount ( float lb | lb = getLowerBoundsImpl ( e ) | lb )
2187+ }
2188+
2189+ /** Counts the numbers of upper bounds that are computed internally for `e`. */
2190+ float countNrOfUpperBounds ( Expr e ) {
2191+ result = strictcount ( float ub | ub = getUpperBoundsImpl ( e ) | ub )
2192+ }
21832193}
21842194
21852195/** Provides predicates for debugging the simple range analysis library. */
@@ -2208,7 +2218,7 @@ private module Debug {
22082218 */
22092219 predicate countGetLowerBoundsImpl ( Expr e , int n ) {
22102220 e = getRelevantLocatable ( ) and
2211- n = strictcount ( float lb | lb = getLowerBoundsImpl ( e ) | lb )
2221+ n = SimpleRangeAnalysisInternal :: countNrOfLowerBounds ( e )
22122222 }
22132223
22142224 float debugNrOfBounds ( Expr e ) {
You can’t perform that action at this time.
0 commit comments