Teach Function.getACall to take virtual dispatch into account.

This commit is contained in:
Max Schaefer
2020-02-05 13:56:47 +00:00
parent 84002f585e
commit 39b7272241

View File

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