Skip to content

Commit e506f63

Browse files
committed
DataFlow: Sync identical files.
1 parent 478f2dc commit e506f63

File tree

6 files changed

+54
-0
lines changed

6 files changed

+54
-0
lines changed

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

+9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ module Consistency {
5858
predicate uniqueParameterNodePositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
5959
none()
6060
}
61+
62+
/** Holds if `n` should be excluded from the consistency test `identityLocalStep`. */
63+
predicate identityLocalStepExclude(Node n) { none() }
6164
}
6265

6366
private class RelevantNode extends Node {
@@ -287,4 +290,10 @@ module Consistency {
287290
not exists(unique(ContentApprox approx | approx = getContentApprox(c))) and
288291
msg = "Non-unique content approximation."
289292
}
293+
294+
query predicate identityLocalStep(Node n, string msg) {
295+
simpleLocalFlowStep(n, n) and
296+
not any(ConsistencyConfiguration c).identityLocalStepExclude(n) and
297+
msg = "Node steps to itself"
298+
}
290299
}

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

+9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ module Consistency {
5858
predicate uniqueParameterNodePositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
5959
none()
6060
}
61+
62+
/** Holds if `n` should be excluded from the consistency test `identityLocalStep`. */
63+
predicate identityLocalStepExclude(Node n) { none() }
6164
}
6265

6366
private class RelevantNode extends Node {
@@ -287,4 +290,10 @@ module Consistency {
287290
not exists(unique(ContentApprox approx | approx = getContentApprox(c))) and
288291
msg = "Non-unique content approximation."
289292
}
293+
294+
query predicate identityLocalStep(Node n, string msg) {
295+
simpleLocalFlowStep(n, n) and
296+
not any(ConsistencyConfiguration c).identityLocalStepExclude(n) and
297+
msg = "Node steps to itself"
298+
}
290299
}

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

+9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ module Consistency {
5858
predicate uniqueParameterNodePositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
5959
none()
6060
}
61+
62+
/** Holds if `n` should be excluded from the consistency test `identityLocalStep`. */
63+
predicate identityLocalStepExclude(Node n) { none() }
6164
}
6265

6366
private class RelevantNode extends Node {
@@ -287,4 +290,10 @@ module Consistency {
287290
not exists(unique(ContentApprox approx | approx = getContentApprox(c))) and
288291
msg = "Non-unique content approximation."
289292
}
293+
294+
query predicate identityLocalStep(Node n, string msg) {
295+
simpleLocalFlowStep(n, n) and
296+
not any(ConsistencyConfiguration c).identityLocalStepExclude(n) and
297+
msg = "Node steps to itself"
298+
}
290299
}

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

+9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ module Consistency {
5858
predicate uniqueParameterNodePositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
5959
none()
6060
}
61+
62+
/** Holds if `n` should be excluded from the consistency test `identityLocalStep`. */
63+
predicate identityLocalStepExclude(Node n) { none() }
6164
}
6265

6366
private class RelevantNode extends Node {
@@ -287,4 +290,10 @@ module Consistency {
287290
not exists(unique(ContentApprox approx | approx = getContentApprox(c))) and
288291
msg = "Non-unique content approximation."
289292
}
293+
294+
query predicate identityLocalStep(Node n, string msg) {
295+
simpleLocalFlowStep(n, n) and
296+
not any(ConsistencyConfiguration c).identityLocalStepExclude(n) and
297+
msg = "Node steps to itself"
298+
}
290299
}

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

+9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ module Consistency {
5858
predicate uniqueParameterNodePositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
5959
none()
6060
}
61+
62+
/** Holds if `n` should be excluded from the consistency test `identityLocalStep`. */
63+
predicate identityLocalStepExclude(Node n) { none() }
6164
}
6265

6366
private class RelevantNode extends Node {
@@ -287,4 +290,10 @@ module Consistency {
287290
not exists(unique(ContentApprox approx | approx = getContentApprox(c))) and
288291
msg = "Non-unique content approximation."
289292
}
293+
294+
query predicate identityLocalStep(Node n, string msg) {
295+
simpleLocalFlowStep(n, n) and
296+
not any(ConsistencyConfiguration c).identityLocalStepExclude(n) and
297+
msg = "Node steps to itself"
298+
}
290299
}

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

+9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ module Consistency {
5858
predicate uniqueParameterNodePositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
5959
none()
6060
}
61+
62+
/** Holds if `n` should be excluded from the consistency test `identityLocalStep`. */
63+
predicate identityLocalStepExclude(Node n) { none() }
6164
}
6265

6366
private class RelevantNode extends Node {
@@ -287,4 +290,10 @@ module Consistency {
287290
not exists(unique(ContentApprox approx | approx = getContentApprox(c))) and
288291
msg = "Non-unique content approximation."
289292
}
293+
294+
query predicate identityLocalStep(Node n, string msg) {
295+
simpleLocalFlowStep(n, n) and
296+
not any(ConsistencyConfiguration c).identityLocalStepExclude(n) and
297+
msg = "Node steps to itself"
298+
}
290299
}

0 commit comments

Comments
 (0)