Make store step to send stmt's channel use post-update node

This commit is contained in:
Owen Mansel-Chan
2025-09-16 21:57:40 +01:00
parent ac71f9cd8e
commit 3229630598
2 changed files with 7 additions and 13 deletions

View File

@@ -36,8 +36,10 @@ predicate containerStoreStep(Node node1, Node node2, Content c) {
) )
or or
c instanceof CollectionContent and c instanceof CollectionContent and
exists(SendStmt send | exists(SendStmt send, Node channelExprNode |
send.getChannel() = node2.(ExprNode).asExpr() and send.getValue() = node1.(ExprNode).asExpr() send.getChannel() = channelExprNode.(ExprNode).asExpr() and
node2.(PostUpdateNode).getPreUpdateNode() = channelExprNode and
send.getValue() = node1.(ExprNode).asExpr()
) )
or or
c instanceof MapKeyContent and c instanceof MapKeyContent and

View File

@@ -1,22 +1,14 @@
invalidModelRow invalidModelRow
edges edges
| test.go:9:9:9:11 | selection of c [collection] | test.go:9:7:9:11 | <-... | provenance | | | test.go:9:9:9:11 | selection of c [collection] | test.go:9:7:9:11 | <-... | provenance | |
| test.go:13:16:13:16 | definition of s [pointer, c, collection] | test.go:16:2:16:2 | s [pointer, c, collection] | provenance | |
| test.go:15:10:15:17 | call to source | test.go:16:9:16:12 | data | provenance | | | test.go:15:10:15:17 | call to source | test.go:16:9:16:12 | data | provenance | |
| test.go:16:2:16:2 | implicit dereference [c, collection] | test.go:13:16:13:16 | definition of s [pointer, c, collection] | provenance | | | test.go:16:2:16:4 | selection of c [postupdate] [collection] | test.go:9:9:9:11 | selection of c [collection] | provenance | |
| test.go:16:2:16:2 | implicit dereference [c, collection] | test.go:16:2:16:4 | selection of c [collection] | provenance | | | test.go:16:9:16:12 | data | test.go:16:2:16:4 | selection of c [postupdate] [collection] | provenance | |
| test.go:16:2:16:2 | s [pointer, c, collection] | test.go:16:2:16:2 | implicit dereference [c, collection] | provenance | |
| test.go:16:2:16:4 | selection of c [collection] | test.go:9:9:9:11 | selection of c [collection] | provenance | |
| test.go:16:2:16:4 | selection of c [collection] | test.go:16:2:16:2 | implicit dereference [c, collection] | provenance | |
| test.go:16:9:16:12 | data | test.go:16:2:16:4 | selection of c [collection] | provenance | |
nodes nodes
| test.go:9:7:9:11 | <-... | semmle.label | <-... | | test.go:9:7:9:11 | <-... | semmle.label | <-... |
| test.go:9:9:9:11 | selection of c [collection] | semmle.label | selection of c [collection] | | test.go:9:9:9:11 | selection of c [collection] | semmle.label | selection of c [collection] |
| test.go:13:16:13:16 | definition of s [pointer, c, collection] | semmle.label | definition of s [pointer, c, collection] |
| test.go:15:10:15:17 | call to source | semmle.label | call to source | | test.go:15:10:15:17 | call to source | semmle.label | call to source |
| test.go:16:2:16:2 | implicit dereference [c, collection] | semmle.label | implicit dereference [c, collection] | | test.go:16:2:16:4 | selection of c [postupdate] [collection] | semmle.label | selection of c [postupdate] [collection] |
| test.go:16:2:16:2 | s [pointer, c, collection] | semmle.label | s [pointer, c, collection] |
| test.go:16:2:16:4 | selection of c [collection] | semmle.label | selection of c [collection] |
| test.go:16:9:16:12 | data | semmle.label | data | | test.go:16:9:16:12 | data | semmle.label | data |
subpaths subpaths
#select #select