mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Swift: Add upgrade and downgrade scripts
This commit is contained in:
@@ -0,0 +1,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, _)
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
description: Add `UnsafeCastExpr`, `TypeValueExpr`, `IntegerType`, and `BuiltinFixedArrayType`.
|
||||
compatibility: backwards
|
||||
|
||||
builtin_fixed_array_types.rel: delete
|
||||
integer_types.rel: delete
|
||||
type_value_exprs.rel: delete
|
||||
unsafe_cast_exprs.rel: delete
|
||||
|
||||
unspecified_elements.rel: run downgrade.ql new_unspecified_elements
|
||||
unspecified_element_children.rel: run downgrade.ql new_unspecified_element_children
|
||||
implicit_conversion_exprs.rel: run downgrade.ql new_implicit_conversion_exprs
|
||||
expr_types.rel: run downgrade.ql new_expr_types
|
||||
types.rel: run downgrade.ql new_types
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Add `UnsafeCastExpr`, `TypeValueExpr`, `IntegerType`, and `BuiltinFixedArrayType`.
|
||||
compatibility: full
|
||||
Reference in New Issue
Block a user