Skip to content

Commit 7c515bb

Browse files
committed
Swift: _ as in _ = ... is a CFG leaf node.
This enables DataFlow to skip over it and not get stuck.
1 parent fdd7d76 commit 7c515bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,14 @@ module Decls {
10151015

10161016
module Exprs {
10171017
module AssignExprs {
1018+
/**
1019+
* The control-flow of a `DiscardAssignmentExpr`, which represents the
1020+
* `_` leaf expression that may appear on the left-hand side of an `AssignExpr`.
1021+
*/
1022+
private class DiscardAssignmentExprTree extends AstLeafTree {
1023+
override DiscardAssignmentExpr ast;
1024+
}
1025+
10181026
/**
10191027
* The control-flow of an assignment operation.
10201028
*

0 commit comments

Comments
 (0)