File tree Expand file tree Collapse file tree 7 files changed +56
-0
lines changed
experimental/semmle/code/cpp/ir/dataflow/internal
csharp/ql/lib/semmle/code/csharp/dataflow/internal
java/ql/lib/semmle/code/java/dataflow/internal
python/ql/lib/semmle/python/dataflow/new/internal
swift/ql/lib/codeql/swift/dataflow/internal Expand file tree Collapse file tree 7 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module Consistency {
32
32
33
33
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
34
34
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 ( ) }
35
41
}
36
42
37
43
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166
172
}
167
173
168
174
query predicate postHasUniquePre ( PostUpdateNode n , string msg ) {
175
+ not any ( ConsistencyConfiguration conf ) .postHasUniquePreExclude ( n ) and
169
176
exists ( int c |
170
177
c = count ( n .getPreUpdateNode ( ) ) and
171
178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174
181
}
175
182
176
183
query predicate uniquePostUpdate ( Node n , string msg ) {
184
+ not any ( ConsistencyConfiguration conf ) .uniquePostUpdateExclude ( n ) and
177
185
1 < strictcount ( PostUpdateNode post | post .getPreUpdateNode ( ) = n ) and
178
186
msg = "Node has multiple PostUpdateNodes."
179
187
}
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module Consistency {
32
32
33
33
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
34
34
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 ( ) }
35
41
}
36
42
37
43
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166
172
}
167
173
168
174
query predicate postHasUniquePre ( PostUpdateNode n , string msg ) {
175
+ not any ( ConsistencyConfiguration conf ) .postHasUniquePreExclude ( n ) and
169
176
exists ( int c |
170
177
c = count ( n .getPreUpdateNode ( ) ) and
171
178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174
181
}
175
182
176
183
query predicate uniquePostUpdate ( Node n , string msg ) {
184
+ not any ( ConsistencyConfiguration conf ) .uniquePostUpdateExclude ( n ) and
177
185
1 < strictcount ( PostUpdateNode post | post .getPreUpdateNode ( ) = n ) and
178
186
msg = "Node has multiple PostUpdateNodes."
179
187
}
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module Consistency {
32
32
33
33
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
34
34
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 ( ) }
35
41
}
36
42
37
43
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166
172
}
167
173
168
174
query predicate postHasUniquePre ( PostUpdateNode n , string msg ) {
175
+ not any ( ConsistencyConfiguration conf ) .postHasUniquePreExclude ( n ) and
169
176
exists ( int c |
170
177
c = count ( n .getPreUpdateNode ( ) ) and
171
178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174
181
}
175
182
176
183
query predicate uniquePostUpdate ( Node n , string msg ) {
184
+ not any ( ConsistencyConfiguration conf ) .uniquePostUpdateExclude ( n ) and
177
185
1 < strictcount ( PostUpdateNode post | post .getPreUpdateNode ( ) = n ) and
178
186
msg = "Node has multiple PostUpdateNodes."
179
187
}
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module Consistency {
32
32
33
33
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
34
34
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 ( ) }
35
41
}
36
42
37
43
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166
172
}
167
173
168
174
query predicate postHasUniquePre ( PostUpdateNode n , string msg ) {
175
+ not any ( ConsistencyConfiguration conf ) .postHasUniquePreExclude ( n ) and
169
176
exists ( int c |
170
177
c = count ( n .getPreUpdateNode ( ) ) and
171
178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174
181
}
175
182
176
183
query predicate uniquePostUpdate ( Node n , string msg ) {
184
+ not any ( ConsistencyConfiguration conf ) .uniquePostUpdateExclude ( n ) and
177
185
1 < strictcount ( PostUpdateNode post | post .getPreUpdateNode ( ) = n ) and
178
186
msg = "Node has multiple PostUpdateNodes."
179
187
}
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module Consistency {
32
32
33
33
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
34
34
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 ( ) }
35
41
}
36
42
37
43
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166
172
}
167
173
168
174
query predicate postHasUniquePre ( PostUpdateNode n , string msg ) {
175
+ not any ( ConsistencyConfiguration conf ) .postHasUniquePreExclude ( n ) and
169
176
exists ( int c |
170
177
c = count ( n .getPreUpdateNode ( ) ) and
171
178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174
181
}
175
182
176
183
query predicate uniquePostUpdate ( Node n , string msg ) {
184
+ not any ( ConsistencyConfiguration conf ) .uniquePostUpdateExclude ( n ) and
177
185
1 < strictcount ( PostUpdateNode post | post .getPreUpdateNode ( ) = n ) and
178
186
msg = "Node has multiple PostUpdateNodes."
179
187
}
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module Consistency {
32
32
33
33
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
34
34
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 ( ) }
35
41
}
36
42
37
43
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166
172
}
167
173
168
174
query predicate postHasUniquePre ( PostUpdateNode n , string msg ) {
175
+ not any ( ConsistencyConfiguration conf ) .postHasUniquePreExclude ( n ) and
169
176
exists ( int c |
170
177
c = count ( n .getPreUpdateNode ( ) ) and
171
178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174
181
}
175
182
176
183
query predicate uniquePostUpdate ( Node n , string msg ) {
184
+ not any ( ConsistencyConfiguration conf ) .uniquePostUpdateExclude ( n ) and
177
185
1 < strictcount ( PostUpdateNode post | post .getPreUpdateNode ( ) = n ) and
178
186
msg = "Node has multiple PostUpdateNodes."
179
187
}
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module Consistency {
32
32
33
33
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
34
34
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 ( ) }
35
41
}
36
42
37
43
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
166
172
}
167
173
168
174
query predicate postHasUniquePre ( PostUpdateNode n , string msg ) {
175
+ not any ( ConsistencyConfiguration conf ) .postHasUniquePreExclude ( n ) and
169
176
exists ( int c |
170
177
c = count ( n .getPreUpdateNode ( ) ) and
171
178
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
174
181
}
175
182
176
183
query predicate uniquePostUpdate ( Node n , string msg ) {
184
+ not any ( ConsistencyConfiguration conf ) .uniquePostUpdateExclude ( n ) and
177
185
1 < strictcount ( PostUpdateNode post | post .getPreUpdateNode ( ) = n ) and
178
186
msg = "Node has multiple PostUpdateNodes."
179
187
}
You can’t perform that action at this time.
0 commit comments