C++: Add a small amount of pruning to 'SizeBarrierConfig'.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-08-25 10:25:28 +01:00
parent ded06a77d0
commit 9c5d7350dc

View File

@@ -222,6 +222,12 @@ private module InterestingPointerAddInstruction {
)
}
/**
* Holds if `n` is a size of an allocation whose result flows to the left operand
* of a pointer-arithmetic instruction.
*
* This predicate is used to reduce the set of tuples in `SizeBarrierConfig::isSource`.
*/
predicate isInterestingSize(DataFlow::Node n) {
exists(DataFlow::Node alloc |
hasSize(alloc.asConvertedExpr(), n, _) and