Improve performance of new barrier guard

Some projects on lgtm were taking >1 hour, and with this commit they take
<10 minutes
This commit is contained in:
Owen Mansel-Chan
2020-08-24 16:13:06 +01:00
parent dbf1d24e19
commit aed3ef4cde

View File

@@ -75,7 +75,7 @@ module AllocationSizeOverflow {
/** A check of the allocation size, acting as a guard to prevent allocation-size overflow. */
class AllocationSizeCheck extends DataFlow::BarrierGuard, DataFlow::RelationalComparisonNode {
override predicate checks(Expr e, boolean branch) {
exists(DataFlow::Node lesser | this.leq(branch, lesser, _, _) |
exists(DataFlow::Node lesser | this.leq(branch, lesser, _, _) and not lesser.isConst() |
globalValueNumber(DataFlow::exprNode(e)) = globalValueNumber(lesser)
)
}