@@ -73,8 +73,12 @@ signature module Input {
73
73
}
74
74
75
75
// Relating nodes to summaries
76
- /** Gets a dataflow node respresenting the argument of `call` indicated by `arg`. */
77
- Node argumentOf ( Node call , SummaryComponent arg , boolean isOutput ) ;
76
+ /**
77
+ * Gets a dataflow node respresenting the argument of `call` indicated by `arg`.
78
+ *
79
+ * Returns the post-update node of the argument when `isPostUpdate` is true.
80
+ */
81
+ Node argumentOf ( Node call , SummaryComponent arg , boolean isPostUpdate ) ;
78
82
79
83
/** Gets a dataflow node respresenting the parameter of `callable` indicated by `param`. */
80
84
Node parameterOf ( Node callable , SummaryComponent param ) ;
@@ -221,7 +225,8 @@ module SummaryFlow<Input I> implements Output<I> {
221
225
222
226
/**
223
227
* Gets a data flow `I::Node` corresponding an argument or return value of `call`,
224
- * as specified by `component`.
228
+ * as specified by `component`. `isOutput` indicates whether the node represents
229
+ * an output node or an input node.
225
230
*/
226
231
bindingset [ call, component]
227
232
private I:: Node evaluateSummaryComponentLocal (
@@ -300,10 +305,16 @@ module SummaryFlow<Input I> implements Output<I> {
300
305
pragma [ only_bind_out ] ( tail ) ) and
301
306
stack = I:: push ( pragma [ only_bind_out ] ( head ) , pragma [ only_bind_out ] ( tail ) )
302
307
|
308
+ // `Parameter[X]` is only allowed in the output of flow summaries (hence `isOutput = true`),
309
+ // however the target of the parameter (e.g. `Argument[Y].Parameter[X]`) should be fetched
310
+ // not from a post-update argument node (hence `isOutput0 = false`)
303
311
result = I:: parameterOf ( prev , head ) and
304
312
isOutput0 = false and
305
313
isOutput = true
306
314
or
315
+ // `ReturnValue` is only allowed in the input of flow summaries (hence `isOutput = false`),
316
+ // and the target of the return value (e.g. `Argument[X].ReturnValue`) should be fetched not
317
+ // from a post-update argument node (hence `isOutput0 = false`)
307
318
result = I:: returnOf ( prev , head ) and
308
319
isOutput0 = false and
309
320
isOutput = false
0 commit comments