Skip to content

Commit 2181588

Browse files
committed
C#: Accept data flow inconsistency check for read+write calls.
1 parent 12b182e commit 2181588

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

csharp/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ private module Input implements InputSig<Location, CsharpDataFlow> {
5656
)
5757
or
5858
call.(NonDelegateDataFlowCall).getDispatchCall().isReflection()
59+
or
60+
// Exclude calls that are both getter and setter calls, as they share the same argument nodes.
61+
exists(AccessorCall ac |
62+
call.(NonDelegateDataFlowCall).getDispatchCall().getCall() = ac and
63+
ac instanceof AssignableRead and
64+
ac instanceof AssignableWrite
65+
)
5966
)
6067
}
6168
}

0 commit comments

Comments
 (0)