Skip to content

Commit a9c9170

Browse files
committed
Swift: fix missing keypath CFGs
1 parent 3738e19 commit a9c9170

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module CfgScope {
6060
private class KeyPathScope extends Range_ instanceof KeyPathExpr {
6161
KeyPathControlFlowTree tree;
6262

63-
KeyPathScope() { tree.asAstNode() = this }
63+
KeyPathScope() { tree.getAst() = this }
6464

6565
final override predicate entry(ControlFlowElement first) { first(tree, first) }
6666

@@ -84,6 +84,8 @@ module CfgScope {
8484
override ControlFlowElement getChildNode(int i) {
8585
result.asAstNode() = super.getAst().getComponent(i)
8686
}
87+
88+
KeyPathExpr getAst() { result = super.getAst() }
8789
}
8890
}
8991

@@ -1663,7 +1665,7 @@ module Exprs {
16631665
}
16641666
}
16651667

1666-
private class NilCoalescingTestTree extends LeafTree instanceof NilCoalescingElement {
1668+
private class NilCoalescingTestTree extends LeafTree instanceof NilCoalescingElement {
16671669
NilCoalescingExpr getAst() { result = super.getAst() }
16681670
}
16691671

0 commit comments

Comments
 (0)