diff --git a/cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll b/cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll index 533899e8a85..245de04d3ce 100644 --- a/cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll +++ b/cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll @@ -45,6 +45,11 @@ module Consistency { ) { none() } + + /** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */ + predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) { + none() + } } private class RelevantNode extends Node { @@ -246,6 +251,7 @@ module Consistency { query predicate uniqueParameterNodeAtPosition( DataFlowCallable c, ParameterPosition pos, Node p, string msg ) { + not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and isParameterNode(p, c, pos) and not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and msg = "Parameters with overlapping positions." diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll index 533899e8a85..245de04d3ce 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll @@ -45,6 +45,11 @@ module Consistency { ) { none() } + + /** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */ + predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) { + none() + } } private class RelevantNode extends Node { @@ -246,6 +251,7 @@ module Consistency { query predicate uniqueParameterNodeAtPosition( DataFlowCallable c, ParameterPosition pos, Node p, string msg ) { + not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and isParameterNode(p, c, pos) and not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and msg = "Parameters with overlapping positions." diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll index 533899e8a85..245de04d3ce 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll @@ -45,6 +45,11 @@ module Consistency { ) { none() } + + /** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */ + predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) { + none() + } } private class RelevantNode extends Node { @@ -246,6 +251,7 @@ module Consistency { query predicate uniqueParameterNodeAtPosition( DataFlowCallable c, ParameterPosition pos, Node p, string msg ) { + not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and isParameterNode(p, c, pos) and not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and msg = "Parameters with overlapping positions." diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll index 533899e8a85..245de04d3ce 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll @@ -45,6 +45,11 @@ module Consistency { ) { none() } + + /** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */ + predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) { + none() + } } private class RelevantNode extends Node { @@ -246,6 +251,7 @@ module Consistency { query predicate uniqueParameterNodeAtPosition( DataFlowCallable c, ParameterPosition pos, Node p, string msg ) { + not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and isParameterNode(p, c, pos) and not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and msg = "Parameters with overlapping positions." diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll index 533899e8a85..245de04d3ce 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll @@ -45,6 +45,11 @@ module Consistency { ) { none() } + + /** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */ + predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) { + none() + } } private class RelevantNode extends Node { @@ -246,6 +251,7 @@ module Consistency { query predicate uniqueParameterNodeAtPosition( DataFlowCallable c, ParameterPosition pos, Node p, string msg ) { + not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and isParameterNode(p, c, pos) and not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and msg = "Parameters with overlapping positions." diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll index 533899e8a85..245de04d3ce 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll @@ -45,6 +45,11 @@ module Consistency { ) { none() } + + /** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */ + predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) { + none() + } } private class RelevantNode extends Node { @@ -246,6 +251,7 @@ module Consistency { query predicate uniqueParameterNodeAtPosition( DataFlowCallable c, ParameterPosition pos, Node p, string msg ) { + not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and isParameterNode(p, c, pos) and not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and msg = "Parameters with overlapping positions." diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplConsistency.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplConsistency.qll index 533899e8a85..245de04d3ce 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplConsistency.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplConsistency.qll @@ -45,6 +45,11 @@ module Consistency { ) { none() } + + /** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */ + predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) { + none() + } } private class RelevantNode extends Node { @@ -246,6 +251,7 @@ module Consistency { query predicate uniqueParameterNodeAtPosition( DataFlowCallable c, ParameterPosition pos, Node p, string msg ) { + not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and isParameterNode(p, c, pos) and not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and msg = "Parameters with overlapping positions." diff --git a/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplConsistency.qll b/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplConsistency.qll index 533899e8a85..245de04d3ce 100644 --- a/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplConsistency.qll +++ b/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplConsistency.qll @@ -45,6 +45,11 @@ module Consistency { ) { none() } + + /** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */ + predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) { + none() + } } private class RelevantNode extends Node { @@ -246,6 +251,7 @@ module Consistency { query predicate uniqueParameterNodeAtPosition( DataFlowCallable c, ParameterPosition pos, Node p, string msg ) { + not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and isParameterNode(p, c, pos) and not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and msg = "Parameters with overlapping positions."