Skip to content

Commit 2f619a4

Browse files
Fix performance issue in ResourceLeakAnalysis.qll
1 parent 4ac7c5c commit 2f619a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cpp/common/src/codingstandards/cpp/resources/ResourceLeakAnalysis.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import cpp
22
import semmle.code.cpp.dataflow.DataFlow
3-
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
3+
import semmle.code.cpp.valuenumbering.HashCons
44
import semmle.code.cpp.controlflow.Dominance
55
import codeql.util.Boolean
66

@@ -40,13 +40,14 @@ signature module ResourceLeakConfigSig {
4040

4141
predicate isFree(ControlFlowNode node, DataFlow::Node resource);
4242

43+
bindingset[node]
4344
default DataFlow::Node getAnAlias(DataFlow::Node node) {
4445
DataFlow::localFlow(node, result)
4546
or
4647
exists(Expr current, Expr after |
4748
current in [node.asExpr(), node.asDefiningArgument()] and
4849
after in [result.asExpr(), result.asDefiningArgument()] and
49-
globalValueNumber(current) = globalValueNumber(after) and
50+
hashCons(current) = hashCons(after) and
5051
strictlyDominates(current, after)
5152
)
5253
}

0 commit comments

Comments
 (0)