Skip to content

Commit 69c9099

Browse files
committed
Look for callees through function variables
1 parent 373017a commit 69c9099

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ module Public {
470470
exists(DataFlow::Node calleeSource | calleeSource = this.getACalleeSource() |
471471
result.asFuncLit() = calleeSource.asExpr()
472472
or
473+
calleeSource = result.asFunction().getARead()
474+
or
473475
exists(Method declared, Method actual |
474476
calleeSource = declared.getARead() and
475477
actual.implements(declared) and

ql/test/library-tests/semmle/go/dataflow/CallGraph/getACallee.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
missingCallee
2-
| test.go:58:2:58:8 | call to f | test.go:41:1:53:1 | function declaration |
32
spuriousCallee
43
| main.go:44:3:44:7 | call to m | main.go:17:1:17:17 | function declaration |
54
| main.go:44:3:44:7 | call to m | main.go:21:1:21:20 | function declaration |

ql/test/library-tests/semmle/go/dataflow/CallGraph/viableCallee.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ missingCallee
33
| test.go:48:2:48:8 | call to f2 | test.go:17:1:20:1 | function declaration |
44
| test.go:48:2:48:8 | call to f2 | test.go:36:1:39:1 | function declaration |
55
| test.go:52:2:52:5 | call to f3 | test.go:11:1:11:28 | function declaration |
6-
| test.go:58:2:58:8 | call to f | test.go:41:1:53:1 | function declaration |
76
spuriousCallee

0 commit comments

Comments
 (0)