diff --git a/ql/src/semmle/go/Expr.qll b/ql/src/semmle/go/Expr.qll index 5b080e639c8..3ea5102d7b6 100644 --- a/ql/src/semmle/go/Expr.qll +++ b/ql/src/semmle/go/Expr.qll @@ -466,21 +466,6 @@ class CallExpr extends CallOrConversionExpr { /** Gets the declared target of this call. */ Function getTarget() { this = result.getACallExpr() } - /** - * Gets the definition of a possible target of this call. - * - * For non-virtual calls, there is at most one possible call target (but there may be none if the - * target has no declaration). - * - * For virtual calls, we look up possible targets in all types that implement the receiver - * interface type. - */ - FuncDef getACallee() { - exists(DataFlow::CallNode call | call.asExpr() = this | - result = call.getACallee() - ) - } - override predicate mayHaveOwnSideEffects() { getTarget().mayHaveSideEffects() or not exists(getTarget()) diff --git a/ql/src/semmle/go/dataflow/internal/DataFlowDispatch.qll b/ql/src/semmle/go/dataflow/internal/DataFlowDispatch.qll index c85e26316ca..71ccabec179 100644 --- a/ql/src/semmle/go/dataflow/internal/DataFlowDispatch.qll +++ b/ql/src/semmle/go/dataflow/internal/DataFlowDispatch.qll @@ -7,7 +7,9 @@ DataFlowCallable viableImpl(DataFlowCall ma) { result = viableCallable(ma) } * Gets a function that might be called by `call`. */ DataFlowCallable viableCallable(CallExpr ma) { - result = ma.getACallee() + exists(DataFlow::CallNode c | c.asExpr() = ma | + result = c.getACallee() + ) } /**