Skip to content

Commit d8e75e6

Browse files
authored
Merge pull request #14717 from github/alexdenisov/fix-cfg-for-single-value-stmt-expr
Swlft: fix CFG for SingleValueStmtExpr
2 parents d510739 + 12f9e3a commit d8e75e6

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,15 @@ module Exprs {
14171417
}
14181418
}
14191419

1420+
/** Control-flow for a `SingleValueStmtExpr`. See the QLDoc for `SingleValueStmtExpr` for the semantics of a `SingleValueStmtExpr`. */
1421+
private class SingleValueStmtExprTree extends AstStandardPostOrderTree {
1422+
override SingleValueStmtExpr ast;
1423+
1424+
final override ControlFlowElement getChildElement(int i) {
1425+
i = 0 and result.asAstNode() = ast.getStmt()
1426+
}
1427+
}
1428+
14201429
private class OpaqueValueExprTree extends AstLeafTree {
14211430
override OpaqueValueExpr ast;
14221431
}

swift/ql/test/extractor-tests/generated/expr/SingleValueStmtExpr/CONSISTENCY/CfgConsistency.expected

Lines changed: 0 additions & 2 deletions
This file was deleted.

swift/ql/test/library-tests/dataflow/flowsources/CONSISTENCY/CfgConsistency.expected

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)