Skip to content

Commit 4fde37c

Browse files
owen-mcCopilot
andcommitted
Make getACallee overlay[global]
Co-authored-by: Copilot <copilot@github.com>
1 parent 7f2a13b commit 4fde37c

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

go/ql/lib/semmle/go/Decls.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Provides classes for working with declarations.
33
*/
4-
overlay[local]
4+
overlay[local?]
55
module;
66

77
import go
@@ -137,6 +137,7 @@ class FuncDef extends @funcdef, StmtParent, ExprParent {
137137
/**
138138
* Gets a call to this function.
139139
*/
140+
overlay[global]
140141
DataFlow::CallNode getACall() { result.getACallee() = this }
141142

142143
/** Holds if this function is variadic. */

go/ql/lib/semmle/go/Scopes.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Provides classes for working with scopes and declared objects.
33
*/
4-
overlay[local]
4+
overlay[local?]
55
module;
66

77
import go
@@ -418,6 +418,7 @@ class Function extends ValueEntity, @functionobject {
418418
* This includes calls that target this function indirectly, by calling an
419419
* interface method that this function implements.
420420
*/
421+
overlay[global]
421422
pragma[nomagic]
422423
DataFlow::CallNode getACall() { this = result.getACalleeIncludingExternals().asFunction() }
423424

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
overlay[local]
1+
overlay[local?]
22
module;
33

44
private import go
@@ -488,6 +488,7 @@ module Public {
488488
* For virtual calls, we look up possible targets in all types that implement the receiver
489489
* interface type.
490490
*/
491+
overlay[global]
491492
Callable getACalleeIncludingExternals() {
492493
result = this.getACalleeWithoutVirtualDispatch()
493494
or
@@ -504,6 +505,7 @@ module Public {
504505
* As `getACalleeIncludingExternals`, except excluding external functions (those for which
505506
* we lack a definition, such as standard library functions).
506507
*/
508+
overlay[global]
507509
pragma[nomagic]
508510
FuncDef getACallee() { result = this.getACalleeIncludingExternals().getFuncDef() }
509511

0 commit comments

Comments
 (0)