@@ -262,21 +262,33 @@ module MakeConsistency<
262
262
not Input:: viableImplInCallContextTooLargeExclude ( call , ctx , callable )
263
263
}
264
264
265
+ private predicate uniqueParameterNodeAtPositionInclude (
266
+ DataFlowCallable c , ParameterPosition pos , Node p
267
+ ) {
268
+ not Input:: uniqueParameterNodeAtPositionExclude ( c , pos , p ) and
269
+ isParameterNode ( p , c , pos )
270
+ }
271
+
265
272
query predicate uniqueParameterNodeAtPosition (
266
273
DataFlowCallable c , ParameterPosition pos , Node p , string msg
267
274
) {
268
- not Input:: uniqueParameterNodeAtPositionExclude ( c , pos , p ) and
269
- isParameterNode ( p , c , pos ) and
270
- not exists ( unique( Node p0 | isParameterNode ( p0 , c , pos ) ) ) and
275
+ uniqueParameterNodeAtPositionInclude ( c , pos , p ) and
276
+ not exists ( unique( Node p0 | uniqueParameterNodeAtPositionInclude ( c , pos , p0 ) ) ) and
271
277
msg = "Parameters with overlapping positions."
272
278
}
273
279
280
+ private predicate uniqueParameterNodePositionInclude (
281
+ DataFlowCallable c , ParameterPosition pos , Node p
282
+ ) {
283
+ not Input:: uniqueParameterNodePositionExclude ( c , pos , p ) and
284
+ isParameterNode ( p , c , pos )
285
+ }
286
+
274
287
query predicate uniqueParameterNodePosition (
275
288
DataFlowCallable c , ParameterPosition pos , Node p , string msg
276
289
) {
277
- not Input:: uniqueParameterNodePositionExclude ( c , pos , p ) and
278
- isParameterNode ( p , c , pos ) and
279
- not exists ( unique( ParameterPosition pos0 | isParameterNode ( p , c , pos0 ) ) ) and
290
+ uniqueParameterNodePositionInclude ( c , pos , p ) and
291
+ not exists ( unique( ParameterPosition pos0 | uniqueParameterNodePositionInclude ( c , pos0 , p ) ) ) and
280
292
msg = "Parameter node with multiple positions."
281
293
}
282
294
@@ -297,13 +309,14 @@ module MakeConsistency<
297
309
msg = "Missing call for argument node."
298
310
}
299
311
300
- query predicate multipleArgumentCall ( ArgumentNode arg , DataFlowCall call , string msg ) {
312
+ private predicate multipleArgumentCallInclude ( ArgumentNode arg , DataFlowCall call ) {
301
313
isArgumentNode ( arg , call , _) and
302
- not Input:: multipleArgumentCallExclude ( arg , call ) and
303
- strictcount ( DataFlowCall call0 |
304
- isArgumentNode ( arg , call0 , _) and
305
- not Input:: multipleArgumentCallExclude ( arg , call0 )
306
- ) > 1 and
314
+ not Input:: multipleArgumentCallExclude ( arg , call )
315
+ }
316
+
317
+ query predicate multipleArgumentCall ( ArgumentNode arg , DataFlowCall call , string msg ) {
318
+ multipleArgumentCallInclude ( arg , call ) and
319
+ strictcount ( DataFlowCall call0 | multipleArgumentCallInclude ( arg , call0 ) ) > 1 and
307
320
msg = "Multiple calls for argument node."
308
321
}
309
322
}
0 commit comments