File tree Expand file tree Collapse file tree 5 files changed +35
-5
lines changed
cpp/ql/src/semmle/code/cpp
csharp/ql/src/semmle/code/csharp/dataflow/internal
java/ql/src/semmle/code/java/dataflow/internal
python/ql/src/semmle/python/dataflow/new/internal Expand file tree Collapse file tree 5 files changed +35
-5
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,13 @@ module Consistency {
168
168
msg = "ArgumentNode is missing PostUpdateNode."
169
169
}
170
170
171
- query predicate postWithInFlow ( PostUpdateNode n , string msg ) {
171
+ // This predicate helps the compiler forget that in some languages
172
+ // it is impossible for a `PostUpdateNode` to be the target of
173
+ // `simpleLocalFlowStep`.
174
+ private predicate isPostUpdateNode ( Node n ) { n instanceof PostUpdateNode or none ( ) }
175
+
176
+ query predicate postWithInFlow ( Node n , string msg ) {
177
+ isPostUpdateNode ( n ) and
172
178
simpleLocalFlowStep ( _, n ) and
173
179
msg = "PostUpdateNode should not be the target of local flow."
174
180
}
Original file line number Diff line number Diff line change @@ -168,7 +168,13 @@ module Consistency {
168
168
msg = "ArgumentNode is missing PostUpdateNode."
169
169
}
170
170
171
- query predicate postWithInFlow ( PostUpdateNode n , string msg ) {
171
+ // This predicate helps the compiler forget that in some languages
172
+ // it is impossible for a `PostUpdateNode` to be the target of
173
+ // `simpleLocalFlowStep`.
174
+ private predicate isPostUpdateNode ( Node n ) { n instanceof PostUpdateNode or none ( ) }
175
+
176
+ query predicate postWithInFlow ( Node n , string msg ) {
177
+ isPostUpdateNode ( n ) and
172
178
simpleLocalFlowStep ( _, n ) and
173
179
msg = "PostUpdateNode should not be the target of local flow."
174
180
}
Original file line number Diff line number Diff line change @@ -168,7 +168,13 @@ module Consistency {
168
168
msg = "ArgumentNode is missing PostUpdateNode."
169
169
}
170
170
171
- query predicate postWithInFlow ( PostUpdateNode n , string msg ) {
171
+ // This predicate helps the compiler forget that in some languages
172
+ // it is impossible for a `PostUpdateNode` to be the target of
173
+ // `simpleLocalFlowStep`.
174
+ private predicate isPostUpdateNode ( Node n ) { n instanceof PostUpdateNode or none ( ) }
175
+
176
+ query predicate postWithInFlow ( Node n , string msg ) {
177
+ isPostUpdateNode ( n ) and
172
178
simpleLocalFlowStep ( _, n ) and
173
179
msg = "PostUpdateNode should not be the target of local flow."
174
180
}
Original file line number Diff line number Diff line change @@ -168,7 +168,13 @@ module Consistency {
168
168
msg = "ArgumentNode is missing PostUpdateNode."
169
169
}
170
170
171
- query predicate postWithInFlow ( PostUpdateNode n , string msg ) {
171
+ // This predicate helps the compiler forget that in some languages
172
+ // it is impossible for a `PostUpdateNode` to be the target of
173
+ // `simpleLocalFlowStep`.
174
+ private predicate isPostUpdateNode ( Node n ) { n instanceof PostUpdateNode or none ( ) }
175
+
176
+ query predicate postWithInFlow ( Node n , string msg ) {
177
+ isPostUpdateNode ( n ) and
172
178
simpleLocalFlowStep ( _, n ) and
173
179
msg = "PostUpdateNode should not be the target of local flow."
174
180
}
Original file line number Diff line number Diff line change @@ -168,7 +168,13 @@ module Consistency {
168
168
msg = "ArgumentNode is missing PostUpdateNode."
169
169
}
170
170
171
- query predicate postWithInFlow ( PostUpdateNode n , string msg ) {
171
+ // This predicate helps the compiler forget that in some languages
172
+ // it is impossible for a `PostUpdateNode` to be the target of
173
+ // `simpleLocalFlowStep`.
174
+ private predicate isPostUpdateNode ( Node n ) { n instanceof PostUpdateNode or none ( ) }
175
+
176
+ query predicate postWithInFlow ( Node n , string msg ) {
177
+ isPostUpdateNode ( n ) and
172
178
simpleLocalFlowStep ( _, n ) and
173
179
msg = "PostUpdateNode should not be the target of local flow."
174
180
}
You can’t perform that action at this time.
0 commit comments