mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
C#: Add missing QlDoc for various predicates
This commit is contained in:
@@ -31,6 +31,7 @@ class ReadRefAccess extends ReadAccess, ReadRef { }
|
||||
|
||||
/** An instruction that writes a variable. */
|
||||
class WriteAccess extends VariableAccess, @cil_write_access {
|
||||
/** Gets the `Expr` whose value is used in this variable write. */
|
||||
Expr getExpr() { none() }
|
||||
}
|
||||
|
||||
|
||||
@@ -437,6 +437,9 @@ class Operator extends Callable, Member, Attributable, @operator {
|
||||
|
||||
override string getName() { operators(this, _, result, _, _, _) }
|
||||
|
||||
/**
|
||||
* Gets the metadata name of the operator, such as `op_implicit` or `op_RightShift`.
|
||||
*/
|
||||
string getFunctionName() { none() }
|
||||
|
||||
override ValueOrRefType getDeclaringType() { operators(this, _, _, result, _, _) }
|
||||
|
||||
@@ -514,6 +514,11 @@ predicate convNullableType(ValueOrRefType fromType, NullableType toType) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `fromType` is `NullType`, and `toType` is a type that can represent
|
||||
* the `null` value, such as a reference type, `Nullable<T>` or a type parameter
|
||||
* with contraints that restrict it to a reference type.
|
||||
*/
|
||||
// This is a deliberate, small Cartesian product, so we have manually lifted it to force the
|
||||
// evaluator to evaluate it in its entirety, rather than trying to optimize it in context.
|
||||
pragma[noinline]
|
||||
|
||||
@@ -26,6 +26,7 @@ class RuntimeMethod extends RuntimeCallable {
|
||||
this instanceof CIL::Method
|
||||
}
|
||||
|
||||
/** Holds if the method is `static`. */
|
||||
predicate isStatic() { this.(Method).isStatic() or this.(CIL::Method).isStatic() }
|
||||
}
|
||||
|
||||
|
||||
@@ -1011,6 +1011,7 @@ class RangeExpr extends Expr, @range_expr {
|
||||
|
||||
/** An index expression, for example `^1` meaning "1 from the end". */
|
||||
class IndexExpr extends Expr, @index_expr {
|
||||
/** Gets the sub expression of this `IndexExpr`. */
|
||||
Expr getExpr() { result.getParent() = this }
|
||||
|
||||
override string toString() { result = "^..." }
|
||||
|
||||
@@ -222,6 +222,10 @@ predicate shareFieldOrProperty(ValueOrRefType t, Method m1, Method m2) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `Method` `m` is declared in `ValueOrRefType` `t`, and if there's a
|
||||
* `FieldAccess` or `PropertyAccess` in `m` that accesses `Declaration` `d`.
|
||||
*/
|
||||
predicate methodUsesFieldOrProperty(ValueOrRefType t, Method m, Declaration d) {
|
||||
m.getDeclaringType() = t and
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user