File tree Expand file tree Collapse file tree 6 files changed +48
-0
lines changed
cpp/ql/lib/semmle/code/cpp
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 6 files changed +48
-0
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments