diff --git a/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.expected b/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.expected index 5ee74a7cde4a..9f29e364be9a 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.expected @@ -1,15 +1,26 @@ -| test.go:19:2:19:2 | definition of a | -| test.go:20:11:20:14 | &... | -| test.go:20:12:20:14 | selection of b | -| test.go:21:2:21:5 | selection of bs | -| test.go:21:2:21:8 | index expression | -| test.go:21:17:21:20 | &... | -| test.go:21:18:21:20 | struct literal | -| test.go:22:2:22:5 | selection of bs | -| test.go:22:2:22:8 | index expression | -| test.go:22:2:22:13 | implicit dereference | -| test.go:22:2:22:13 | selection of cptr | -| test.go:23:2:23:7 | implicit dereference | -| test.go:23:2:23:7 | selection of bptr | -| test.go:23:2:23:12 | implicit dereference | -| test.go:23:2:23:12 | selection of cptr | +| file://:0:0:0:0 | [summary] to write: Argument[0] in copy | file://:0:0:0:0 | [summary param] 0 in copy | +| test.go:22:2:22:2 | definition of a | test.go:23:2:23:2 | a | +| test.go:22:2:22:2 | definition of a | test.go:24:2:24:2 | a | +| test.go:22:2:22:2 | definition of a | test.go:25:2:25:2 | a | +| test.go:22:2:22:2 | definition of a | test.go:26:2:26:2 | a | +| test.go:22:2:22:2 | definition of a | test.go:29:6:29:6 | a | +| test.go:22:2:22:2 | definition of a | test.go:30:7:30:7 | a | +| test.go:22:2:22:2 | definition of a | test.go:35:4:35:4 | a | +| test.go:22:2:22:2 | definition of a | test.go:36:5:36:5 | a | +| test.go:23:11:23:14 | &... | test.go:23:11:23:14 | &... | +| test.go:23:12:23:14 | selection of b | test.go:23:12:23:14 | selection of b | +| test.go:24:2:24:5 | selection of bs | test.go:24:2:24:5 | selection of bs | +| test.go:24:2:24:8 | index expression | test.go:24:2:24:8 | index expression | +| test.go:24:17:24:20 | &... | test.go:24:17:24:20 | &... | +| test.go:24:18:24:20 | struct literal | test.go:24:18:24:20 | struct literal | +| test.go:25:2:25:5 | selection of bs | test.go:25:2:25:5 | selection of bs | +| test.go:25:2:25:8 | index expression | test.go:25:2:25:8 | index expression | +| test.go:25:2:25:13 | implicit dereference | test.go:25:2:25:13 | implicit dereference | +| test.go:25:2:25:13 | selection of cptr | test.go:25:2:25:13 | selection of cptr | +| test.go:26:2:26:7 | implicit dereference | test.go:26:2:26:7 | implicit dereference | +| test.go:26:2:26:7 | selection of bptr | test.go:26:2:26:7 | selection of bptr | +| test.go:26:2:26:12 | implicit dereference | test.go:26:2:26:12 | implicit dereference | +| test.go:26:2:26:12 | selection of cptr | test.go:26:2:26:12 | selection of cptr | +| test.go:28:2:28:2 | definition of c | test.go:29:2:29:2 | c | +| test.go:28:2:28:2 | definition of c | test.go:30:2:30:2 | c | +| test.go:28:7:28:10 | struct literal | test.go:28:7:28:10 | struct literal | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.go b/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.go index f9d4b3d8e65d..3cb8656b96dd 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.go +++ b/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.go @@ -4,6 +4,9 @@ type C struct { field int } +func (c C) m(a A) {} +func (c *C) mp(a A) {} + type B struct { cptr *C } @@ -22,4 +25,13 @@ func f() { a.bs[3].cptr.field = 100 a.bptr.cptr.field = 101 + c := C{0} + c.m(a) + c.mp(a) + + // Indirect method calls - missing post-update nodes for the receivers + f := c.m + fp := c.mp + f(a) + fp(a) } diff --git a/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.ql b/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.ql index 384b3346431c..ca2a9c5980b5 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.ql +++ b/go/ql/test/library-tests/semmle/go/dataflow/PostUpdateNodes/test.ql @@ -1,4 +1,4 @@ import go from DataFlow::PostUpdateNode pun -select pun +select pun, pun.getPreUpdateNode()