diff --git a/ql/src/semmle/go/Scopes.qll b/ql/src/semmle/go/Scopes.qll index dc6e8ef52b9..0fc1060e18f 100644 --- a/ql/src/semmle/go/Scopes.qll +++ b/ql/src/semmle/go/Scopes.qll @@ -280,7 +280,11 @@ class Function extends ValueEntity, @functionobject { CallExpr getACallExpr() { result.getCalleeExpr() = getAReference() } /** Gets a call to this function. */ - DataFlow::CallNode getACall() { result.getExpr() = getACallExpr() } + DataFlow::CallNode getACall() { + this = result.getTarget() + or + this.(DeclaredFunction).getFuncDecl() = result.getACallee() + } /** Holds if this function has no observable side effects. */ predicate mayHaveSideEffects() { none() }