Skip to content

Commit 6ffe5fc

Browse files
committed
Swift: Comment some other cases.
1 parent 537caf8 commit 6ffe5fc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,13 @@ private module Cached {
108108
localFlowSsaInput(nodeFrom, def, nodeTo.asDefinition())
109109
)
110110
or
111+
// flow through writes to inout parameters
111112
exists(ParamReturnKind kind, ExprCfgNode arg |
112113
arg = nodeFrom.(InOutUpdateNode).getCall(kind).asCall().getArgument(kind.getIndex()) and
113114
nodeTo.asDefinition().(Ssa::WriteDefinition).isInoutDef(arg)
114115
)
115116
or
117+
// flow through `&` (inout argument)
116118
nodeFrom.asExpr() = nodeTo.asExpr().(InOutExpr).getSubExpr()
117119
or
118120
// flow through `try!` and similar constructs

0 commit comments

Comments
 (0)