File tree Expand file tree Collapse file tree 3 files changed +5254
-5234
lines changed
lib/semmle/code/cpp/rangeanalysis
test/library-tests/rangeanalysis/SimpleRangeAnalysis Expand file tree Collapse file tree 3 files changed +5254
-5234
lines changed Original file line number Diff line number Diff line change @@ -2180,6 +2180,14 @@ 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+ float countNrOfLowerBounds ( Expr e ) {
2185+ result = strictcount ( float lb | lb = getLowerBoundsImpl ( e ) | lb )
2186+ }
2187+
2188+ float countNrOfUpperBounds ( Expr e ) {
2189+ result = strictcount ( float ub | ub = getUpperBoundsImpl ( e ) | ub )
2190+ }
21832191}
21842192
21852193/** Provides predicates for debugging the simple range analysis library. */
@@ -2208,7 +2216,7 @@ private module Debug {
22082216 */
22092217 predicate countGetLowerBoundsImpl ( Expr e , int n ) {
22102218 e = getRelevantLocatable ( ) and
2211- n = strictcount ( float lb | lb = getLowerBoundsImpl ( e ) | lb )
2219+ n = SimpleRangeAnalysisInternal :: countNrOfLowerBounds ( e )
22122220 }
22132221
22142222 float debugNrOfBounds ( Expr e ) {
You can’t perform that action at this time.
0 commit comments