Skip to content

Commit d836871

Browse files
committed
C#: Add postupdate nodes for all instance parameter accesses - otherwise we get missing post update nodes to to reverseRead in the data flow consistency queries.
1 parent 28d5c11 commit d836871

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -953,12 +953,8 @@ private module Cached {
953953
callCfn = any(Call c | isParamsArg(c, _, _)).getAControlFlowNode()
954954
} or
955955
TFlowInsensitiveFieldNode(FieldOrProperty f) { f.isFieldLike() } or
956-
TInstanceParameterAccessNode(ControlFlow::Node cfn, boolean isPostUpdate) {
957-
exists(ParameterAccess pa | cfn = getAPrimaryConstructorParameterCfn(pa) |
958-
isPostUpdate = false
959-
or
960-
pa instanceof ParameterWrite and isPostUpdate = true
961-
)
956+
TInstanceParameterAccessNode(ControlFlow::Node cfn, Boolean isPostUpdate) {
957+
cfn = getAPrimaryConstructorParameterCfn(_)
962958
} or
963959
TPrimaryConstructorThisAccessNode(Parameter p, Boolean isPostUpdate) {
964960
p.getCallable() instanceof PrimaryConstructor

0 commit comments

Comments
 (0)