mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Introduce cast for <unsafe-coerce> calls
This commit is contained in:
@@ -747,6 +747,7 @@ case @expr.kind of
|
||||
| 83 = @stringtemplateexpr
|
||||
| 84 = @varargexpr
|
||||
| 85 = @notnullexpr
|
||||
| 86 = @unsafecoerceexpr
|
||||
;
|
||||
|
||||
/** Holds if this `when` expression was written as an `if` expression. */
|
||||
|
||||
@@ -1144,7 +1144,8 @@ class CastingExpr extends Expr {
|
||||
this instanceof @safecastexpr or
|
||||
this instanceof @implicitcastexpr or
|
||||
this instanceof @implicitnotnullexpr or
|
||||
this instanceof @implicitcoerciontounitexpr
|
||||
this instanceof @implicitcoerciontounitexpr or
|
||||
this instanceof @unsafecoerceexpr
|
||||
}
|
||||
|
||||
/** Gets the target type of this casting expression. */
|
||||
@@ -1194,6 +1195,14 @@ class ImplicitCoercionToUnitExpr extends CastingExpr, @implicitcoerciontounitexp
|
||||
override string getAPrimaryQlClass() { result = "ImplicitCoercionToUnitExpr" }
|
||||
}
|
||||
|
||||
/** An unsafe coerce expression. */
|
||||
class UnsafeCoerceExpr extends CastingExpr, @unsafecoerceexpr {
|
||||
/** Gets a printable representation of this expression. */
|
||||
override string toString() { result = "<unsafe coerce>" }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "UnsafeCoerceExpr" }
|
||||
}
|
||||
|
||||
/** A class instance creation expression. */
|
||||
class ClassInstanceExpr extends Expr, ConstructorCall, @classinstancexpr {
|
||||
/** Gets the number of arguments provided to the constructor of the class instance creation expression. */
|
||||
|
||||
Reference in New Issue
Block a user