Skip to content

Commit 3a9c34c

Browse files
authored
Merge pull request #14132 from hvitved/csharp/data-flow-property-write
C#: Fix logic for flow into property writes
2 parents a11db7a + 55aedbc commit 3a9c34c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,14 @@ private module ArgumentNodes {
11651165
) {
11661166
e1.(Argument).isArgumentOf(e2, _) and
11671167
exactScope = false and
1168-
scope = e2 and
1169-
isSuccessor = true
1168+
isSuccessor = true and
1169+
if e2 instanceof PropertyWrite
1170+
then
1171+
exists(AssignableDefinition def |
1172+
def.getTargetAccess() = e2 and
1173+
scope = def.getExpr()
1174+
)
1175+
else scope = e2
11701176
}
11711177
}
11721178

0 commit comments

Comments
 (0)