-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathdowngrade.ql
More file actions
50 lines (43 loc) · 1.35 KB
/
downgrade.ql
File metadata and controls
50 lines (43 loc) · 1.35 KB
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
41
42
43
44
45
46
47
48
49
50
class Element extends @element {
string toString() { none() }
}
predicate removedClass(Element e, string name, Element child) {
type_value_exprs(e, child) and
name = "TypeValueExpr"
or
unsafe_cast_exprs(e) and
name = "UnsafeCastExpr" and
implicit_conversion_exprs(e, child)
}
predicate removedClass(Element e, string name) {
integer_types(e, _) and
name = "IntegerType"
or
builtin_fixed_array_types(e) and
name = "BuiltinFixedArrayType"
or
removedClass(e, name, _)
}
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, _)
}
query predicate new_types(Element e, string name, Element canonicalType) {
types(e, name, canonicalType) and not removedClass(e, _)
}