Merge pull request #10444 from hvitved/ruby/stmt-sequence-post-update

Ruby: Add post-update nodes for compound arguments
This commit is contained in:
Tom Hvitved
2022-09-22 13:18:51 +02:00
committed by GitHub
13 changed files with 506 additions and 154 deletions

View File

@@ -32,6 +32,12 @@ module Consistency {
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
predicate reverseReadExclude(Node n) { none() }
/** Holds if `n` should be excluded from the consistency test `postHasUniquePre`. */
predicate postHasUniquePreExclude(PostUpdateNode n) { none() }
/** Holds if `n` should be excluded from the consistency test `uniquePostUpdate`. */
predicate uniquePostUpdateExclude(Node n) { none() }
}
private class RelevantNode extends Node {
@@ -166,6 +172,7 @@ module Consistency {
}
query predicate postHasUniquePre(PostUpdateNode n, string msg) {
not any(ConsistencyConfiguration conf).postHasUniquePreExclude(n) and
exists(int c |
c = count(n.getPreUpdateNode()) and
c != 1 and
@@ -174,6 +181,7 @@ module Consistency {
}
query predicate uniquePostUpdate(Node n, string msg) {
not any(ConsistencyConfiguration conf).uniquePostUpdateExclude(n) and
1 < strictcount(PostUpdateNode post | post.getPreUpdateNode() = n) and
msg = "Node has multiple PostUpdateNodes."
}