Skip to content

Commit db8b6ac

Browse files
committed
Data flow: Sync files
1 parent 59caa97 commit db8b6ac

File tree

7 files changed

+56
-0
lines changed

7 files changed

+56
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ module Consistency {
3232

3333
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
3434
predicate reverseReadExclude(Node n) { none() }
35+
36+
/** Holds if `n` should be excluded from the consistency test `postHasUniquePre`. */
37+
predicate postHasUniquePreExclude(PostUpdateNode n) { none() }
38+
39+
/** Holds if `n` should be excluded from the consistency test `uniquePostUpdate`. */
40+
predicate uniquePostUpdateExclude(Node n) { none() }
3541
}
3642

3743
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166172
}
167173

168174
query predicate postHasUniquePre(PostUpdateNode n, string msg) {
175+
not any(ConsistencyConfiguration conf).postHasUniquePreExclude(n) and
169176
exists(int c |
170177
c = count(n.getPreUpdateNode()) and
171178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174181
}
175182

176183
query predicate uniquePostUpdate(Node n, string msg) {
184+
not any(ConsistencyConfiguration conf).uniquePostUpdateExclude(n) and
177185
1 < strictcount(PostUpdateNode post | post.getPreUpdateNode() = n) and
178186
msg = "Node has multiple PostUpdateNodes."
179187
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ module Consistency {
3232

3333
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
3434
predicate reverseReadExclude(Node n) { none() }
35+
36+
/** Holds if `n` should be excluded from the consistency test `postHasUniquePre`. */
37+
predicate postHasUniquePreExclude(PostUpdateNode n) { none() }
38+
39+
/** Holds if `n` should be excluded from the consistency test `uniquePostUpdate`. */
40+
predicate uniquePostUpdateExclude(Node n) { none() }
3541
}
3642

3743
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166172
}
167173

168174
query predicate postHasUniquePre(PostUpdateNode n, string msg) {
175+
not any(ConsistencyConfiguration conf).postHasUniquePreExclude(n) and
169176
exists(int c |
170177
c = count(n.getPreUpdateNode()) and
171178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174181
}
175182

176183
query predicate uniquePostUpdate(Node n, string msg) {
184+
not any(ConsistencyConfiguration conf).uniquePostUpdateExclude(n) and
177185
1 < strictcount(PostUpdateNode post | post.getPreUpdateNode() = n) and
178186
msg = "Node has multiple PostUpdateNodes."
179187
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ module Consistency {
3232

3333
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
3434
predicate reverseReadExclude(Node n) { none() }
35+
36+
/** Holds if `n` should be excluded from the consistency test `postHasUniquePre`. */
37+
predicate postHasUniquePreExclude(PostUpdateNode n) { none() }
38+
39+
/** Holds if `n` should be excluded from the consistency test `uniquePostUpdate`. */
40+
predicate uniquePostUpdateExclude(Node n) { none() }
3541
}
3642

3743
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166172
}
167173

168174
query predicate postHasUniquePre(PostUpdateNode n, string msg) {
175+
not any(ConsistencyConfiguration conf).postHasUniquePreExclude(n) and
169176
exists(int c |
170177
c = count(n.getPreUpdateNode()) and
171178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174181
}
175182

176183
query predicate uniquePostUpdate(Node n, string msg) {
184+
not any(ConsistencyConfiguration conf).uniquePostUpdateExclude(n) and
177185
1 < strictcount(PostUpdateNode post | post.getPreUpdateNode() = n) and
178186
msg = "Node has multiple PostUpdateNodes."
179187
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ module Consistency {
3232

3333
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
3434
predicate reverseReadExclude(Node n) { none() }
35+
36+
/** Holds if `n` should be excluded from the consistency test `postHasUniquePre`. */
37+
predicate postHasUniquePreExclude(PostUpdateNode n) { none() }
38+
39+
/** Holds if `n` should be excluded from the consistency test `uniquePostUpdate`. */
40+
predicate uniquePostUpdateExclude(Node n) { none() }
3541
}
3642

3743
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166172
}
167173

168174
query predicate postHasUniquePre(PostUpdateNode n, string msg) {
175+
not any(ConsistencyConfiguration conf).postHasUniquePreExclude(n) and
169176
exists(int c |
170177
c = count(n.getPreUpdateNode()) and
171178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174181
}
175182

176183
query predicate uniquePostUpdate(Node n, string msg) {
184+
not any(ConsistencyConfiguration conf).uniquePostUpdateExclude(n) and
177185
1 < strictcount(PostUpdateNode post | post.getPreUpdateNode() = n) and
178186
msg = "Node has multiple PostUpdateNodes."
179187
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ module Consistency {
3232

3333
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
3434
predicate reverseReadExclude(Node n) { none() }
35+
36+
/** Holds if `n` should be excluded from the consistency test `postHasUniquePre`. */
37+
predicate postHasUniquePreExclude(PostUpdateNode n) { none() }
38+
39+
/** Holds if `n` should be excluded from the consistency test `uniquePostUpdate`. */
40+
predicate uniquePostUpdateExclude(Node n) { none() }
3541
}
3642

3743
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166172
}
167173

168174
query predicate postHasUniquePre(PostUpdateNode n, string msg) {
175+
not any(ConsistencyConfiguration conf).postHasUniquePreExclude(n) and
169176
exists(int c |
170177
c = count(n.getPreUpdateNode()) and
171178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174181
}
175182

176183
query predicate uniquePostUpdate(Node n, string msg) {
184+
not any(ConsistencyConfiguration conf).uniquePostUpdateExclude(n) and
177185
1 < strictcount(PostUpdateNode post | post.getPreUpdateNode() = n) and
178186
msg = "Node has multiple PostUpdateNodes."
179187
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ module Consistency {
3232

3333
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
3434
predicate reverseReadExclude(Node n) { none() }
35+
36+
/** Holds if `n` should be excluded from the consistency test `postHasUniquePre`. */
37+
predicate postHasUniquePreExclude(PostUpdateNode n) { none() }
38+
39+
/** Holds if `n` should be excluded from the consistency test `uniquePostUpdate`. */
40+
predicate uniquePostUpdateExclude(Node n) { none() }
3541
}
3642

3743
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166172
}
167173

168174
query predicate postHasUniquePre(PostUpdateNode n, string msg) {
175+
not any(ConsistencyConfiguration conf).postHasUniquePreExclude(n) and
169176
exists(int c |
170177
c = count(n.getPreUpdateNode()) and
171178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174181
}
175182

176183
query predicate uniquePostUpdate(Node n, string msg) {
184+
not any(ConsistencyConfiguration conf).uniquePostUpdateExclude(n) and
177185
1 < strictcount(PostUpdateNode post | post.getPreUpdateNode() = n) and
178186
msg = "Node has multiple PostUpdateNodes."
179187
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ module Consistency {
3232

3333
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
3434
predicate reverseReadExclude(Node n) { none() }
35+
36+
/** Holds if `n` should be excluded from the consistency test `postHasUniquePre`. */
37+
predicate postHasUniquePreExclude(PostUpdateNode n) { none() }
38+
39+
/** Holds if `n` should be excluded from the consistency test `uniquePostUpdate`. */
40+
predicate uniquePostUpdateExclude(Node n) { none() }
3541
}
3642

3743
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166172
}
167173

168174
query predicate postHasUniquePre(PostUpdateNode n, string msg) {
175+
not any(ConsistencyConfiguration conf).postHasUniquePreExclude(n) and
169176
exists(int c |
170177
c = count(n.getPreUpdateNode()) and
171178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174181
}
175182

176183
query predicate uniquePostUpdate(Node n, string msg) {
184+
not any(ConsistencyConfiguration conf).uniquePostUpdateExclude(n) and
177185
1 < strictcount(PostUpdateNode post | post.getPreUpdateNode() = n) and
178186
msg = "Node has multiple PostUpdateNodes."
179187
}

0 commit comments

Comments
 (0)