1- import python
1+ /**
2+ * Provides consistency queries for checking invariants in the language-specific
3+ * data-flow classes and predicates.
4+ */
5+
6+ private import python
27import semmle.python.dataflow.new.DataFlow:: DataFlow
3- import semmle.python.dataflow.new.internal.DataFlowPrivate
4- import semmle.python.dataflow.new.internal.DataFlowImplConsistency:: Consistency
8+ private import semmle.python.dataflow.new.internal.DataFlowImplSpecific
9+ private import semmle.python.dataflow.new.internal.TaintTrackingImplSpecific
10+ private import codeql.dataflow.internal.DataFlowImplConsistency
11+
12+ private module Input implements InputSig< PythonDataFlow > {
13+ private import Private
14+ private import Public
515
6- private class MyConsistencyConfiguration extends ConsistencyConfiguration {
7- override predicate argHasPostUpdateExclude ( ArgumentNode n ) {
16+ predicate argHasPostUpdateExclude ( ArgumentNode n ) {
817 exists ( ArgumentPosition apos | n .argumentOf ( _, apos ) and apos .isStarArgs ( _) )
918 or
1019 exists ( ArgumentPosition apos | n .argumentOf ( _, apos ) and apos .isDictSplat ( ) )
1120 }
1221
13- override predicate reverseReadExclude ( Node n ) {
22+ predicate reverseReadExclude ( Node n ) {
1423 // since `self`/`cls` parameters can be marked as implicit argument to `super()`,
1524 // they will have PostUpdateNodes. We have a read-step from the synthetic `**kwargs`
1625 // parameter, but dataflow-consistency queries should _not_ complain about there not
1726 // being a post-update node for the synthetic `**kwargs` parameter.
1827 n instanceof SynthDictSplatParameterNode
1928 }
2029
21- override predicate uniqueParameterNodePositionExclude (
22- DataFlowCallable c , ParameterPosition pos , Node p
23- ) {
30+ predicate uniqueParameterNodePositionExclude ( DataFlowCallable c , ParameterPosition pos , Node p ) {
2431 // For normal parameters that can both be passed as positional arguments or keyword
2532 // arguments, we currently have parameter positions for both cases..
2633 //
@@ -34,11 +41,17 @@ private class MyConsistencyConfiguration extends ConsistencyConfiguration {
3441 )
3542 }
3643
37- override predicate uniqueCallEnclosingCallableExclude ( DataFlowCall call ) {
44+ predicate uniqueCallEnclosingCallableExclude ( DataFlowCall call ) {
3845 not exists ( call .getLocation ( ) .getFile ( ) .getRelativePath ( ) )
3946 }
4047
41- override predicate identityLocalStepExclude ( Node n ) {
48+ predicate identityLocalStepExclude ( Node n ) {
4249 not exists ( n .getLocation ( ) .getFile ( ) .getRelativePath ( ) )
4350 }
51+
52+ predicate multipleArgumentCallExclude ( ArgumentNode arg , DataFlowCall call ) {
53+ isArgumentNode ( arg , call , _)
54+ }
4455}
56+
57+ import MakeConsistency< PythonDataFlow , PythonTaintTracking , Input >
0 commit comments