@@ -17,7 +17,7 @@ class SummarizedCallableBase = AbstractFunctionDecl;
17
17
DataFlowCallable inject ( SummarizedCallable c ) { result = TDataFlowFunc ( c ) }
18
18
19
19
/** Gets the parameter position of the instance parameter. */
20
- ArgumentPosition instanceParameterPosition ( ) { none ( ) } // disables implicit summary flow to `this` for callbacks
20
+ ArgumentPosition instanceParameterPosition ( ) { result instanceof ThisArgumentPosition }
21
21
22
22
/** Gets the synthesized summary data-flow node for the given values. */
23
23
Node summaryNode ( SummarizedCallable c , SummaryNodeState state ) { result = TSummaryNode ( c , state ) }
@@ -31,23 +31,23 @@ DataFlowType getContentType(Content c) { any() }
31
31
/** Gets the return type of kind `rk` for callable `c`. */
32
32
bindingset [ c]
33
33
DataFlowType getReturnType ( SummarizedCallable c , ReturnKind rk ) {
34
- any ( ) // TODO
34
+ any ( ) // TODO once we have type pruning
35
35
}
36
36
37
37
/**
38
38
* Gets the type of the parameter matching arguments at position `pos` in a
39
39
* synthesized call that targets a callback of type `t`.
40
40
*/
41
41
DataFlowType getCallbackParameterType ( DataFlowType t , ArgumentPosition pos ) {
42
- none ( ) // TODO
42
+ any ( ) // TODO once we have type pruning
43
43
}
44
44
45
45
/**
46
46
* Gets the return type of kind `rk` in a synthesized call that targets a
47
47
* callback of type `t`.
48
48
*/
49
49
DataFlowType getCallbackReturnType ( DataFlowType t , ReturnKind rk ) {
50
- none ( ) // TODO
50
+ any ( ) // TODO once we have type pruning
51
51
}
52
52
53
53
/**
@@ -97,12 +97,12 @@ predicate sinkElement(Element e, string input, string kind, boolean generated) {
97
97
/** Gets the summary component for specification component `c`, if any. */
98
98
bindingset [ c]
99
99
SummaryComponent interpretComponentSpecific ( AccessPathToken c ) {
100
- none ( ) // TODO
100
+ none ( ) // TODO once we have field flow
101
101
}
102
102
103
103
/** Gets the textual representation of the content in the format used for flow summaries. */
104
104
private string getContentSpecificCsv ( Content c ) {
105
- none ( ) // TODO
105
+ none ( ) // TODO once we have field flow
106
106
}
107
107
108
108
/** Gets the textual representation of a summary component in the format used for flow summaries. */
@@ -117,14 +117,10 @@ string getComponentSpecificCsv(SummaryComponent sc) {
117
117
}
118
118
119
119
/** Gets the textual representation of a parameter position in the format used for flow summaries. */
120
- string getParameterPositionCsv ( ParameterPosition pos ) {
121
- none ( ) // TODO
122
- }
120
+ string getParameterPositionCsv ( ParameterPosition pos ) { result = pos .toString ( ) }
123
121
124
122
/** Gets the textual representation of an argument position in the format used for flow summaries. */
125
- string getArgumentPositionCsv ( ArgumentPosition pos ) {
126
- none ( ) // TODO
127
- }
123
+ string getArgumentPositionCsv ( ArgumentPosition pos ) { result = pos .toString ( ) }
128
124
129
125
/** Holds if input specification component `c` needs a reference. */
130
126
predicate inputNeedsReferenceSpecific ( string c ) { none ( ) }
@@ -187,11 +183,21 @@ predicate interpretInputSpecific(string c, InterpretNode mid, InterpretNode n) {
187
183
/** Gets the argument position obtained by parsing `X` in `Parameter[X]`. */
188
184
bindingset [ s]
189
185
ArgumentPosition parseParamBody ( string s ) {
190
- none ( ) // TODO
186
+ exists ( int index | index = AccessPath:: parseInt ( s ) |
187
+ result .( PositionalArgumentPosition ) .getIndex ( ) = index
188
+ or
189
+ index = - 1 and
190
+ result instanceof ThisArgumentPosition
191
+ )
191
192
}
192
193
193
194
/** Gets the parameter position obtained by parsing `X` in `Argument[X]`. */
194
195
bindingset [ s]
195
196
ParameterPosition parseArgBody ( string s ) {
196
- none ( ) // TODO
197
+ exists ( int index | index = AccessPath:: parseInt ( s ) |
198
+ result .( PositionalParameterPosition ) .getIndex ( ) = index
199
+ or
200
+ index = - 1 and
201
+ result instanceof ThisParameterPosition
202
+ )
197
203
}
0 commit comments