Skip to content

Commit 28e9420

Browse files
committed
C#: Fix lambda flow.
1 parent e4ee7c9 commit 28e9420

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3050,8 +3050,11 @@ predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preserves
30503050
exists(AssignableDefinition def |
30513051
def.getTargetAccess() = fa and
30523052
nodeFrom.asExpr() = def.getSource() and
3053-
nodeTo = TFlowInsensitiveFieldNode(f) and
3053+
nodeTo = TFlowInsensitiveFieldNode(f)
3054+
|
30543055
nodeFrom.getEnclosingCallable() instanceof Constructor
3056+
or
3057+
nodeFrom.getEnclosingCallable() instanceof ObjectInitMethod
30553058
)
30563059
or
30573060
nodeFrom = TFlowInsensitiveFieldNode(f) and

0 commit comments

Comments
 (0)