From 28e9420476474214e792d9f46908f922c282335d Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Fri, 5 Dec 2025 10:58:01 +0100 Subject: [PATCH] C#: Fix lambda flow. --- .../semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll index 3aaff74da17..a05651b4c64 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll @@ -3050,8 +3050,11 @@ predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preserves exists(AssignableDefinition def | def.getTargetAccess() = fa and nodeFrom.asExpr() = def.getSource() and - nodeTo = TFlowInsensitiveFieldNode(f) and + nodeTo = TFlowInsensitiveFieldNode(f) + | nodeFrom.getEnclosingCallable() instanceof Constructor + or + nodeFrom.getEnclosingCallable() instanceof ObjectInitMethod ) or nodeFrom = TFlowInsensitiveFieldNode(f) and