@@ -30,10 +30,16 @@ private module SummaryFlowConfig implements Input {
30
30
}
31
31
32
32
Node argumentOf ( Node call , SummaryComponent arg , boolean isPostUpdate ) {
33
+ // Note: we cannot rely on DataFlowPrivate::DataFlowCall here because that depends on the call graph.
33
34
exists ( ArgumentPosition apos , ParameterPosition ppos , Node argNode |
34
35
arg = argument ( ppos ) and
35
36
parameterMatch ( ppos , apos ) and
36
- isArgumentNode ( argNode , any ( DataFlowCall c | c .asOrdinaryCall ( ) = call ) , apos )
37
+ (
38
+ argNode = call .( DataFlow:: InvokeNode ) .getArgument ( apos .asPositional ( ) )
39
+ or
40
+ apos .isThis ( ) and
41
+ argNode = call .( DataFlow:: CallNode ) .getReceiver ( )
42
+ )
37
43
|
38
44
isPostUpdate = true and result = argNode .getPostUpdateNode ( )
39
45
or
@@ -42,11 +48,15 @@ private module SummaryFlowConfig implements Input {
42
48
}
43
49
44
50
Node parameterOf ( Node callable , SummaryComponent param ) {
45
- exists ( ArgumentPosition apos , ParameterPosition ppos , Function function |
51
+ exists ( ArgumentPosition apos , ParameterPosition ppos , DataFlow :: FunctionNode function |
46
52
param = parameter ( apos ) and
47
53
parameterMatch ( ppos , apos ) and
48
- callable = function .flow ( ) and
49
- isParameterNode ( result , any ( DataFlowCallable c | c .asSourceCallable ( ) = function ) , ppos )
54
+ callable = function
55
+ |
56
+ result = function .getParameter ( ppos .asPositional ( ) )
57
+ or
58
+ ppos .isThis ( ) and
59
+ result = function .getReceiver ( )
50
60
)
51
61
}
52
62
0 commit comments