mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
Generalise result type of getACallee.
This commit is contained in:
@@ -473,15 +473,15 @@ class CallExpr extends CallOrConversionExpr {
|
||||
Function getTarget() { this = result.getACallExpr() }
|
||||
|
||||
/**
|
||||
* Gets the declaration of a possible target of this call.
|
||||
* 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.
|
||||
* For virtual calls, we look up possible targets in all types that implement the receiver
|
||||
* interface type.
|
||||
*/
|
||||
FuncDecl getACallee() {
|
||||
FuncDef getACallee() {
|
||||
result = getTarget().(DeclaredFunction).getDecl()
|
||||
or
|
||||
exists(SelectorExpr sel, InterfaceType declaredRecv, Type actualRecv |
|
||||
|
||||
@@ -272,8 +272,8 @@ class CallNode extends ExprNode {
|
||||
/** Gets the declared target of this call */
|
||||
Function getTarget() { result = expr.getTarget() }
|
||||
|
||||
/** Get the declaration of a possible target of this call. See `CallExpr.getACallee`. */
|
||||
FuncDecl getACallee() { result = expr.getACallee() }
|
||||
/** Get the definition of a possible target of this call. See `CallExpr.getACallee`. */
|
||||
FuncDef getACallee() { result = expr.getACallee() }
|
||||
|
||||
/** Gets the name of the function or method being called, if it can be determined. */
|
||||
string getCalleeName() { result = expr.getTarget().getName() }
|
||||
|
||||
Reference in New Issue
Block a user