Don't track receivers into virtual calls.

This commit is contained in:
Max Schaefer
2020-02-20 14:52:01 +00:00
parent d1e020f74d
commit 5fbae15d0e

View File

@@ -430,10 +430,17 @@ class ArgumentNode extends Node {
* Holds if this argument occurs at the given position in the given call.
*
* The receiver argument is considered to have index `-1`.
*
* Note that we currently do not track receiver arguments into calls to interface methods.
*/
predicate argumentOf(CallExpr call, int pos) {
call = c.asExpr() and
pos = i
pos = i and
(
i != -1
or
exists(c.(MethodCallNode).getTarget().getBody())
)
}
/**