Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit aed3ef4

Browse files
committed
Improve performance of new barrier guard
Some projects on lgtm were taking >1 hour, and with this commit they take <10 minutes
1 parent dbf1d24 commit aed3ef4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ql/src/semmle/go/security/AllocationSizeOverflowCustomizations.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module AllocationSizeOverflow {
7575
/** A check of the allocation size, acting as a guard to prevent allocation-size overflow. */
7676
class AllocationSizeCheck extends DataFlow::BarrierGuard, DataFlow::RelationalComparisonNode {
7777
override predicate checks(Expr e, boolean branch) {
78-
exists(DataFlow::Node lesser | this.leq(branch, lesser, _, _) |
78+
exists(DataFlow::Node lesser | this.leq(branch, lesser, _, _) and not lesser.isConst() |
7979
globalValueNumber(DataFlow::exprNode(e)) = globalValueNumber(lesser)
8080
)
8181
}

0 commit comments

Comments
 (0)