Skip to content

Commit 2b0a5fd

Browse files
committed
DataFlow: Add uniqueParameterNodeAtPositionExclude
1 parent 2e4f4c6 commit 2b0a5fd

File tree

8 files changed

+48
-0
lines changed

8 files changed

+48
-0
lines changed

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module Consistency {
4545
) {
4646
none()
4747
}
48+
49+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */
50+
predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
51+
none()
52+
}
4853
}
4954

5055
private class RelevantNode extends Node {
@@ -246,6 +251,7 @@ module Consistency {
246251
query predicate uniqueParameterNodeAtPosition(
247252
DataFlowCallable c, ParameterPosition pos, Node p, string msg
248253
) {
254+
not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and
249255
isParameterNode(p, c, pos) and
250256
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
251257
msg = "Parameters with overlapping positions."

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module Consistency {
4545
) {
4646
none()
4747
}
48+
49+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */
50+
predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
51+
none()
52+
}
4853
}
4954

5055
private class RelevantNode extends Node {
@@ -246,6 +251,7 @@ module Consistency {
246251
query predicate uniqueParameterNodeAtPosition(
247252
DataFlowCallable c, ParameterPosition pos, Node p, string msg
248253
) {
254+
not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and
249255
isParameterNode(p, c, pos) and
250256
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
251257
msg = "Parameters with overlapping positions."

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module Consistency {
4545
) {
4646
none()
4747
}
48+
49+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */
50+
predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
51+
none()
52+
}
4853
}
4954

5055
private class RelevantNode extends Node {
@@ -246,6 +251,7 @@ module Consistency {
246251
query predicate uniqueParameterNodeAtPosition(
247252
DataFlowCallable c, ParameterPosition pos, Node p, string msg
248253
) {
254+
not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and
249255
isParameterNode(p, c, pos) and
250256
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
251257
msg = "Parameters with overlapping positions."

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module Consistency {
4545
) {
4646
none()
4747
}
48+
49+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */
50+
predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
51+
none()
52+
}
4853
}
4954

5055
private class RelevantNode extends Node {
@@ -246,6 +251,7 @@ module Consistency {
246251
query predicate uniqueParameterNodeAtPosition(
247252
DataFlowCallable c, ParameterPosition pos, Node p, string msg
248253
) {
254+
not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and
249255
isParameterNode(p, c, pos) and
250256
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
251257
msg = "Parameters with overlapping positions."

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module Consistency {
4545
) {
4646
none()
4747
}
48+
49+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */
50+
predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
51+
none()
52+
}
4853
}
4954

5055
private class RelevantNode extends Node {
@@ -246,6 +251,7 @@ module Consistency {
246251
query predicate uniqueParameterNodeAtPosition(
247252
DataFlowCallable c, ParameterPosition pos, Node p, string msg
248253
) {
254+
not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and
249255
isParameterNode(p, c, pos) and
250256
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
251257
msg = "Parameters with overlapping positions."

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module Consistency {
4545
) {
4646
none()
4747
}
48+
49+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */
50+
predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
51+
none()
52+
}
4853
}
4954

5055
private class RelevantNode extends Node {
@@ -246,6 +251,7 @@ module Consistency {
246251
query predicate uniqueParameterNodeAtPosition(
247252
DataFlowCallable c, ParameterPosition pos, Node p, string msg
248253
) {
254+
not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and
249255
isParameterNode(p, c, pos) and
250256
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
251257
msg = "Parameters with overlapping positions."

ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module Consistency {
4545
) {
4646
none()
4747
}
48+
49+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */
50+
predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
51+
none()
52+
}
4853
}
4954

5055
private class RelevantNode extends Node {
@@ -246,6 +251,7 @@ module Consistency {
246251
query predicate uniqueParameterNodeAtPosition(
247252
DataFlowCallable c, ParameterPosition pos, Node p, string msg
248253
) {
254+
not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and
249255
isParameterNode(p, c, pos) and
250256
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
251257
msg = "Parameters with overlapping positions."

swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module Consistency {
4545
) {
4646
none()
4747
}
48+
49+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */
50+
predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
51+
none()
52+
}
4853
}
4954

5055
private class RelevantNode extends Node {
@@ -246,6 +251,7 @@ module Consistency {
246251
query predicate uniqueParameterNodeAtPosition(
247252
DataFlowCallable c, ParameterPosition pos, Node p, string msg
248253
) {
254+
not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and
249255
isParameterNode(p, c, pos) and
250256
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
251257
msg = "Parameters with overlapping positions."

0 commit comments

Comments
 (0)