-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathdowngrade.ql
40 lines (35 loc) · 1.23 KB
/
downgrade.ql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class Element extends @element {
string toString() { none() }
}
predicate removedClass(Element e, string name, Element child) {
current_context_isolation_exprs(e, child) and name = "CurrentContextIsolationExpr"
or
extract_function_isolation_exprs(e, child) and name = "ExtractFunctionIsolationExpr"
or
(
actor_isolation_erasure_exprs(e) and name = "ActorIsolationErasureExpr"
or
unreachable_exprs(e) and name = "UnreachableExpr"
) and
implicit_conversion_exprs(e, child)
}
query predicate new_unspecified_elements(Element e, string property, string error) {
unspecified_elements(e, property, error)
or
exists(string name |
removedClass(e, name, _) and
property = "" and
error = name + " nodes removed during database downgrade. Please update your CodeQL code."
)
}
query predicate new_unspecified_element_children(Element e, int index, Element child) {
unspecified_element_children(e, index, child)
or
removedClass(e, _, child) and index = 0
}
query predicate new_implicit_conversion_exprs(Element e, Element child) {
implicit_conversion_exprs(e, child) and not removedClass(e, _, _)
}
query predicate new_expr_types(Element e, Element type) {
expr_types(e, type) and not removedClass(e, _, _)
}