C++: More pruning.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-08-24 16:40:57 +01:00
parent bdad9e197b
commit ded06a77d0

View File

@@ -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, _)
)
}
}
/**