Generalise result type of getACallee.

This commit is contained in:
Max Schaefer
2020-01-03 13:57:58 +00:00
parent 59498f53f0
commit bb4052a574
2 changed files with 6 additions and 6 deletions

View File

@@ -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 |

View File

@@ -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() }