mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++: Add number of bounds test to simple range analysis
This commit is contained in:
@@ -2140,4 +2140,7 @@ module SimpleRangeAnalysisInternal {
|
|||||||
// bound is `typeUpperBound`.
|
// bound is `typeUpperBound`.
|
||||||
defMightOverflowNegatively(def, v) and result = varMaxVal(v)
|
defMightOverflowNegatively(def, v) and result = varMaxVal(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Gets the estimate of the number of bounds for `e`. */
|
||||||
|
float estimateNrOfBounds(Expr e) { result = BoundsEstimate::nrOfBoundsExpr(e) }
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
|||||||
|
import cpp
|
||||||
|
import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis
|
||||||
|
|
||||||
|
from Expr e
|
||||||
|
select e, SimpleRangeAnalysisInternal::estimateNrOfBounds(e)
|
||||||
Reference in New Issue
Block a user