Skip to content

Commit 57f6859

Browse files
committed
Shared: Update type tracking consistency checks
1 parent 5f087f0 commit 57f6859

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,23 @@ module TypeTracking<TypeTrackingInput I> {
3333
* Holds if there is any node in a step relation that is unreachable from a
3434
* `LocalSourceNode`.
3535
*/
36-
query predicate unreachableNode(string msg) {
37-
exists(int k, string kind |
38-
k = strictcount(Node n | stepEntry(n, kind) and not flowsTo(_, n)) and
39-
msg = "There are " + k + " unreachable nodes in steps of kind " + kind + "."
36+
query predicate unreachableNode(Node n, string msg) {
37+
exists(string kind |
38+
stepEntry(n, kind) and
39+
not flowsTo(_, n) and
40+
msg = "Unreachable node in step of kind " + kind + "."
4041
)
4142
}
4243

4344
/**
4445
* Holds if there is a store target that isn't a `LocalSourceNode` and
4546
* backtracking store target feature isn't enabled.
4647
*/
47-
query predicate nonSourceStoreTarget(string msg) {
48+
query predicate nonSourceStoreTarget(Node n, string msg) {
4849
not hasFeatureBacktrackStoreTarget() and
49-
exists(int k |
50-
k =
51-
strictcount(Node n |
52-
not n instanceof LocalSourceNode and
53-
(storeStep(_, n, _) or loadStoreStep(_, n, _, _))
54-
) and
55-
msg =
56-
"There are " + k +
57-
" store targets that are not local source nodes and backtracking store targets is not enabled."
58-
)
50+
not n instanceof LocalSourceNode and
51+
(storeStep(_, n, _) or loadStoreStep(_, n, _, _)) and
52+
msg = "Store target is not a local source nodes and backtracking store targets is disabled."
5953
}
6054
}
6155

0 commit comments

Comments
 (0)