Skip to content

Commit 21a369d

Browse files
d10cMathiasVP
authored andcommitted
Swift: Add closure content read-write steps
1 parent c04654d commit 21a369d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

swift/ql/lib/codeql/swift/dataflow/internal/DataFlowPrivate.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,8 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
10421042
or
10431043
FlowSummaryImpl::Private::Steps::summaryStoreStep(node1.(FlowSummaryNode).getSummaryNode(), c,
10441044
node2.(FlowSummaryNode).getSummaryNode())
1045+
or
1046+
captureStoreStep(node1, any(Content::CapturedVariableContent cvc | c.isSingleton(cvc)), node2)
10451047
}
10461048

10471049
predicate isLValue(Expr e) { any(AssignExpr assign).getDest() = e }
@@ -1146,6 +1148,8 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
11461148
or
11471149
FlowSummaryImpl::Private::Steps::summaryReadStep(node1.(FlowSummaryNode).getSummaryNode(), c,
11481150
node2.(FlowSummaryNode).getSummaryNode())
1151+
or
1152+
captureReadStep(node1, any(Content::CapturedVariableContent cvc | c.isSingleton(cvc)), node2)
11491153
}
11501154

11511155
/**

0 commit comments

Comments
 (0)