@@ -58,6 +58,16 @@ signature module InputSig<DF::InputSig DataFlowLang> {
5858
5959 /** Holds if `n` should be excluded from the consistency test `identityLocalStep`. */
6060 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+ }
6171}
6272
6373module MakeConsistency<
@@ -147,13 +157,6 @@ module MakeConsistency<
147157 )
148158 }
149159
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-
157160 query predicate parameterCallable ( ParameterNode p , string msg ) {
158161 exists ( DataFlowCallable c | isParameterNode ( p , c , _) and c != nodeGetEnclosingCallable ( p ) ) and
159162 msg = "Callable mismatch for parameter."
@@ -287,4 +290,20 @@ module MakeConsistency<
287290 not Input:: identityLocalStepExclude ( n ) and
288291 msg = "Node steps to itself"
289292 }
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+ }
290309}
0 commit comments