Skip to content

Commit 7879cb1

Browse files
committed
fu minor cfg bug
1 parent a72b455 commit 7879cb1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

csharp/ql/lib/semmle/code/csharp/controlflow/ControlFlowGraph.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ private module Ast implements AstSig<Location> {
2626

2727
class AstNode = ControlFlowElementOrCallable;
2828

29+
private predicate skipControlFlow(AstNode e) {
30+
e instanceof TypeAccess and
31+
not e instanceof TypeAccessPatternExpr
32+
}
33+
2934
private AstNode getExprChild0(Expr e, int i) {
3035
not e instanceof NameOfExpr and
3136
not e instanceof AnonymousFunctionExpr and
37+
not skipControlFlow(result) and
3238
result = e.getChild(i)
3339
}
3440

@@ -344,7 +350,7 @@ private module Input implements InputSig1, InputSig2 {
344350
exists(QualifiableExpr qe | qe.isConditional() | n = getQualifier(qe))
345351
}
346352

347-
predicate postOrInOrder(Ast::AstNode n) { n instanceof YieldBreakStmt or n instanceof Call }
353+
predicate postOrInOrder(Ast::AstNode n) { n instanceof YieldStmt or n instanceof Call }
348354

349355
predicate beginAbruptCompletion(
350356
Ast::AstNode ast, PreControlFlowNode n, AbruptCompletion c, boolean always

0 commit comments

Comments
 (0)