mirror of
https://github.com/github/codeql.git
synced 2025-12-22 19:56:32 +01:00
C++: More pruning.
This commit is contained in:
@@ -101,7 +101,8 @@ private module SizeBarrier {
|
||||
predicate isSource(DataFlow::Node source) {
|
||||
// The sources is the same as in the sources for the second
|
||||
// projection in the `AllocToInvalidPointerConfig` module.
|
||||
hasSize(_, source, _)
|
||||
hasSize(_, source, _) and
|
||||
InterestingPointerAddInstruction::isInterestingSize(source)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,6 +221,13 @@ private module InterestingPointerAddInstruction {
|
||||
flowTo(n)
|
||||
)
|
||||
}
|
||||
|
||||
predicate isInterestingSize(DataFlow::Node n) {
|
||||
exists(DataFlow::Node alloc |
|
||||
hasSize(alloc.asConvertedExpr(), n, _) and
|
||||
flow(alloc, _)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user