@@ -58,6 +58,16 @@ signature module InputSig<DF::InputSig DataFlowLang> {
58
58
59
59
/** Holds if `n` should be excluded from the consistency test `identityLocalStep`. */
60
60
default predicate identityLocalStepExclude ( DataFlowLang:: Node n ) { none ( ) }
61
+
62
+ /** Holds if `arg` should be excluded from the consistency test `missingArgumentCall`. */
63
+ default predicate missingArgumentCallExclude ( DataFlowLang:: ArgumentNode arg ) { none ( ) }
64
+
65
+ /** Holds if `(arg, call)` should be excluded from the consistency test `multipleArgumentCall`. */
66
+ default predicate multipleArgumentCallExclude (
67
+ DataFlowLang:: ArgumentNode arg , DataFlowLang:: DataFlowCall call
68
+ ) {
69
+ none ( )
70
+ }
61
71
}
62
72
63
73
module MakeConsistency<
@@ -147,13 +157,6 @@ module MakeConsistency<
147
157
)
148
158
}
149
159
150
- query predicate missingToString ( string msg ) {
151
- exists ( int c |
152
- c = strictcount ( Node n | not exists ( n .toString ( ) ) ) and
153
- msg = "Nodes without toString: " + c
154
- )
155
- }
156
-
157
160
query predicate parameterCallable ( ParameterNode p , string msg ) {
158
161
exists ( DataFlowCallable c | isParameterNode ( p , c , _) and c != nodeGetEnclosingCallable ( p ) ) and
159
162
msg = "Callable mismatch for parameter."
@@ -287,4 +290,20 @@ module MakeConsistency<
287
290
not Input:: identityLocalStepExclude ( n ) and
288
291
msg = "Node steps to itself"
289
292
}
293
+
294
+ query predicate missingArgumentCall ( ArgumentNode arg , string msg ) {
295
+ not Input:: missingArgumentCallExclude ( arg ) and
296
+ not isArgumentNode ( arg , _, _) and
297
+ msg = "Missing call for argument node."
298
+ }
299
+
300
+ query predicate multipleArgumentCall ( ArgumentNode arg , DataFlowCall call , string msg ) {
301
+ 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
307
+ msg = "Multiple calls for argument node."
308
+ }
290
309
}
0 commit comments