Merge pull request #6094 from hvitved/dataflow/consistency-compiler-too-smart

Data flow: Workaround for too clever compiler in consistency queries
This commit is contained in:
Tom Hvitved
2021-06-17 10:23:31 +02:00
committed by GitHub
5 changed files with 35 additions and 5 deletions

View File

@@ -168,7 +168,13 @@ module Consistency {
msg = "ArgumentNode is missing PostUpdateNode."
}
query predicate postWithInFlow(PostUpdateNode n, string msg) {
// This predicate helps the compiler forget that in some languages
// it is impossible for a `PostUpdateNode` to be the target of
// `simpleLocalFlowStep`.
private predicate isPostUpdateNode(Node n) { n instanceof PostUpdateNode or none() }
query predicate postWithInFlow(Node n, string msg) {
isPostUpdateNode(n) and
simpleLocalFlowStep(_, n) and
msg = "PostUpdateNode should not be the target of local flow."
}