Skip to content

Commit 4a510f7

Browse files
committed
unified: More precise CFG node for implicit setter arguments
1 parent 6741896 commit 4a510f7

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎unified/ql/lib/codeql/unified/internal/dataflow/DataFlowNode.qll‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,19 @@ class BuilderNode extends TDataFlowNodeStage1 {
379379
exists(DataFlowCall call, Expr access, boolean isPost |
380380
this.isImplicitArgument(call, _, isPost)
381381
|
382-
(
383-
access = call.asExplicitCall()
384-
or
385-
access = call.asGetterCall()
386-
or
387-
access = call.asSetterCall()
388-
) and
382+
(access = call.asExplicitCall() or access = call.asGetterCall()) and
389383
(
390384
isPost = false and cfgNode.injects(access)
391385
or
392386
isPost = true and cfgNode.isAfter(access)
393387
)
388+
or
389+
access = call.asSetterCall() and
390+
exists(Assignment assignment | isInAssignmentContext(access, assignment) |
391+
isPost = false and cfgNode.injects(assignment)
392+
or
393+
isPost = true and cfgNode.isAfter(assignment)
394+
)
394395
)
395396
)
396397
}

0 commit comments

Comments
 (0)