Skip to content

Commit b9809b4

Browse files
committed
Swift: CFG for opening existentials.
1 parent 02c73d3 commit b9809b4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,6 +1551,18 @@ module Exprs {
15511551
}
15521552
}
15531553

1554+
private class OpenExistentialTree extends AstStandardPostOrderTree {
1555+
override OpenExistentialExpr ast;
1556+
1557+
override ControlFlowElement getChildElement(int i) {
1558+
i = 0 and
1559+
result.asAstNode() = ast.getExistential().getFullyConverted()
1560+
or
1561+
i = 1 and
1562+
result.asAstNode() = ast.getSubExpr().getFullyConverted()
1563+
}
1564+
}
1565+
15541566
module Conversions {
15551567
class ConversionOrIdentity = @identity_expr or @explicit_cast_expr or @implicit_conversion_expr;
15561568

0 commit comments

Comments
 (0)