mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C#: Simplify the ForEachCapture query.
Co-authored-by: Tom Hvitved <hvitved@github.com>
This commit is contained in:
@@ -75,10 +75,9 @@ Element getAssignmentTarget(Expr e) {
|
||||
|
||||
Element getCollectionAssignmentTarget(Expr e) {
|
||||
// Store into collection via method
|
||||
exists(DataFlow::Node postNode, Expr nodeExp |
|
||||
exists(DataFlowPrivate::PostUpdateNode postNode |
|
||||
FlowSummaryImpl::Private::Steps::summarySetterStep(DataFlow::exprNode(e), _, postNode) and
|
||||
nodeExp = postNode.(DataFlowPrivate::PostUpdateNode).getPreUpdateNode().asExpr() and
|
||||
result.(Variable).getAnAccess() = nodeExp
|
||||
result.(Variable).getAnAccess() = postNode.getPreUpdateNode().asExpr()
|
||||
)
|
||||
or
|
||||
// Array initializer
|
||||
|
||||
Reference in New Issue
Block a user