Skip to content

Commit 52f3a48

Browse files
committed
Data flow: Sync files
1 parent e66a3c4 commit 52f3a48

File tree

7 files changed

+112
-0
lines changed

7 files changed

+112
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,20 @@ module Consistency {
244244
not callable = viableCallable(call) and
245245
not any(ConsistencyConfiguration c).viableImplInCallContextTooLargeExclude(call, ctx, callable)
246246
}
247+
248+
query predicate uniqueParameterNodeAtPosition(
249+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
250+
) {
251+
isParameterNode(p, c, pos) and
252+
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
253+
msg = "Parameters with overlapping positions."
254+
}
255+
256+
query predicate uniqueParameterNodePosition(
257+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
258+
) {
259+
isParameterNode(p, c, pos) and
260+
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
261+
msg = "Parameter node with multiple positions."
262+
}
247263
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,20 @@ module Consistency {
244244
not callable = viableCallable(call) and
245245
not any(ConsistencyConfiguration c).viableImplInCallContextTooLargeExclude(call, ctx, callable)
246246
}
247+
248+
query predicate uniqueParameterNodeAtPosition(
249+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
250+
) {
251+
isParameterNode(p, c, pos) and
252+
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
253+
msg = "Parameters with overlapping positions."
254+
}
255+
256+
query predicate uniqueParameterNodePosition(
257+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
258+
) {
259+
isParameterNode(p, c, pos) and
260+
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
261+
msg = "Parameter node with multiple positions."
262+
}
247263
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,20 @@ module Consistency {
244244
not callable = viableCallable(call) and
245245
not any(ConsistencyConfiguration c).viableImplInCallContextTooLargeExclude(call, ctx, callable)
246246
}
247+
248+
query predicate uniqueParameterNodeAtPosition(
249+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
250+
) {
251+
isParameterNode(p, c, pos) and
252+
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
253+
msg = "Parameters with overlapping positions."
254+
}
255+
256+
query predicate uniqueParameterNodePosition(
257+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
258+
) {
259+
isParameterNode(p, c, pos) and
260+
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
261+
msg = "Parameter node with multiple positions."
262+
}
247263
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,20 @@ module Consistency {
244244
not callable = viableCallable(call) and
245245
not any(ConsistencyConfiguration c).viableImplInCallContextTooLargeExclude(call, ctx, callable)
246246
}
247+
248+
query predicate uniqueParameterNodeAtPosition(
249+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
250+
) {
251+
isParameterNode(p, c, pos) and
252+
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
253+
msg = "Parameters with overlapping positions."
254+
}
255+
256+
query predicate uniqueParameterNodePosition(
257+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
258+
) {
259+
isParameterNode(p, c, pos) and
260+
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
261+
msg = "Parameter node with multiple positions."
262+
}
247263
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,20 @@ module Consistency {
244244
not callable = viableCallable(call) and
245245
not any(ConsistencyConfiguration c).viableImplInCallContextTooLargeExclude(call, ctx, callable)
246246
}
247+
248+
query predicate uniqueParameterNodeAtPosition(
249+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
250+
) {
251+
isParameterNode(p, c, pos) and
252+
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
253+
msg = "Parameters with overlapping positions."
254+
}
255+
256+
query predicate uniqueParameterNodePosition(
257+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
258+
) {
259+
isParameterNode(p, c, pos) and
260+
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
261+
msg = "Parameter node with multiple positions."
262+
}
247263
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,20 @@ module Consistency {
244244
not callable = viableCallable(call) and
245245
not any(ConsistencyConfiguration c).viableImplInCallContextTooLargeExclude(call, ctx, callable)
246246
}
247+
248+
query predicate uniqueParameterNodeAtPosition(
249+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
250+
) {
251+
isParameterNode(p, c, pos) and
252+
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
253+
msg = "Parameters with overlapping positions."
254+
}
255+
256+
query predicate uniqueParameterNodePosition(
257+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
258+
) {
259+
isParameterNode(p, c, pos) and
260+
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
261+
msg = "Parameter node with multiple positions."
262+
}
247263
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,20 @@ module Consistency {
244244
not callable = viableCallable(call) and
245245
not any(ConsistencyConfiguration c).viableImplInCallContextTooLargeExclude(call, ctx, callable)
246246
}
247+
248+
query predicate uniqueParameterNodeAtPosition(
249+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
250+
) {
251+
isParameterNode(p, c, pos) and
252+
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
253+
msg = "Parameters with overlapping positions."
254+
}
255+
256+
query predicate uniqueParameterNodePosition(
257+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
258+
) {
259+
isParameterNode(p, c, pos) and
260+
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
261+
msg = "Parameter node with multiple positions."
262+
}
247263
}

0 commit comments

Comments
 (0)