@@ -2,18 +2,20 @@ private import go
22private import DataFlowPrivate
33
44/**
5- * Holds if `call` is an interface call to method `m`, meaning that its receiver `recv` has an
6- * interface type.
5+ * Holds if `call` is an interface call to method `m`, meaning that its receiver `recv` has
6+ * interface type `tp` .
77 */
8- private predicate isInterfaceCallReceiver ( DataFlow:: CallNode call , DataFlow:: Node recv , string m ) {
8+ private predicate isInterfaceCallReceiver (
9+ DataFlow:: CallNode call , DataFlow:: Node recv , InterfaceType tp , string m
10+ ) {
911 call .getReceiver ( ) = recv and
10- recv .getType ( ) .getUnderlyingType ( ) instanceof InterfaceType and
12+ recv .getType ( ) .getUnderlyingType ( ) = tp and
1113 m = call .getCalleeName ( )
1214}
1315
1416/** Gets a data-flow node that may flow into the receiver value of `call`, which is an interface value. */
1517private DataFlow:: Node getInterfaceCallReceiverSource ( DataFlow:: CallNode call ) {
16- isInterfaceCallReceiver ( call , result .getASuccessor * ( ) , _)
18+ isInterfaceCallReceiver ( call , result .getASuccessor * ( ) , _, _ )
1719}
1820
1921/** Gets the type of `nd`, which must be a valid type and not an interface type. */
@@ -44,7 +46,7 @@ private predicate isConcreteValue(DataFlow::Node nd) {
4446 * types of `recv` can be established by local reasoning.
4547 */
4648private predicate isConcreteInterfaceCall ( DataFlow:: Node call , DataFlow:: Node recv , string m ) {
47- isInterfaceCallReceiver ( call , recv , m ) and isConcreteValue ( recv )
49+ isInterfaceCallReceiver ( call , recv , _ , m ) and isConcreteValue ( recv )
4850}
4951
5052/**
0 commit comments