Skip to content

Commit 93163a7

Browse files
committed
fu: CFG cond context for extension method calls
1 parent 031cac9 commit 93163a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ private module Input implements InputSig1, InputSig2 {
345345

346346
predicate inConditionalContext(Ast::AstNode n, ConditionKind kind) {
347347
kind.isNullness() and
348-
exists(QualifiableExpr qe | n = qe.getQualifier() and qe.isConditional())
348+
exists(QualifiableExpr qe | qe.isConditional() |
349+
n = qe.getQualifier() or qe.(ExtensionMethodCall).getArgument(0) = n
350+
)
349351
}
350352

351353
predicate postOrInOrder(Ast::AstNode n) { n instanceof YieldBreakStmt or n instanceof Call }

0 commit comments

Comments
 (0)