mirror of
https://github.com/github/codeql.git
synced 2026-02-23 18:33:42 +01:00
C++: Include the actual number of lower/upper bounds for added context in expected files
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,20 @@ import cpp
|
||||
import utils.test.InlineExpectationsTest
|
||||
import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis
|
||||
|
||||
query predicate estimateNrOfBounds(Expr e, float nrOfBounds) {
|
||||
nrOfBounds = SimpleRangeAnalysisInternal::estimateNrOfBounds(e)
|
||||
query predicate estimateNrOfBounds(
|
||||
Expr e, float nrOfBounds, float actualNrOfLowerBounds, float actualNrOfUpperBounds
|
||||
) {
|
||||
nrOfBounds = SimpleRangeAnalysisInternal::estimateNrOfBounds(e) and
|
||||
(
|
||||
actualNrOfLowerBounds = SimpleRangeAnalysisInternal::countNrOfLowerBounds(e)
|
||||
or
|
||||
not exists(SimpleRangeAnalysisInternal::countNrOfLowerBounds(e)) and actualNrOfLowerBounds = -1
|
||||
) and
|
||||
(
|
||||
actualNrOfUpperBounds = SimpleRangeAnalysisInternal::countNrOfUpperBounds(e)
|
||||
or
|
||||
not exists(SimpleRangeAnalysisInternal::countNrOfUpperBounds(e)) and actualNrOfUpperBounds = -1
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user