Skip to content

Commit 9b38028

Browse files
committed
Data flow: Fix localWriteStep consistency query
1 parent f377d25 commit 9b38028

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

shared/dataflow/codeql/dataflow/VariableCapture.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,10 @@ module Flow<InputSig Input> implements OutputSig<Input> {
371371
query predicate uniqueWriteCfgNode(string msg) { uniqueWriteCfgNode(_, msg) }
372372

373373
private predicate localWriteStep(VariableWrite vw, string msg) {
374-
exists(BasicBlock bb |
375-
vw.hasCfgNode(bb, _) and
376-
bb.getEnclosingCallable() != vw.getVariable().getCallable() and
374+
exists(BasicBlock bb1, BasicBlock bb2 |
375+
vw.hasCfgNode(bb1, _) and
376+
vw.getSource().hasCfgNode(bb2, _) and
377+
bb1.getEnclosingCallable() != bb2.getEnclosingCallable() and
377378
msg = "VariableWrite is not a local step"
378379
)
379380
}

0 commit comments

Comments
 (0)