mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Exclude nullness sources that are deemed non-null.
This commit is contained in:
@@ -442,13 +442,16 @@ class DereferenceableExpr extends Expr {
|
||||
|
||||
/** Holds if `guard` suggests that this expression may be `null`. */
|
||||
predicate guardSuggestsMaybeNull(Guards::Guard guard) {
|
||||
guard = this.getANullnessNullCheck(_, true)
|
||||
or
|
||||
LogicInput::additionalNullCheck(guard, _, this, true)
|
||||
or
|
||||
guard.isEquality(this, any(Expr n | nullValueImplied(n)), _)
|
||||
or
|
||||
Guards::nullGuard(guard, any(GuardValue v | exists(v.asBooleanValue())), this, true)
|
||||
not nonNullValueImplied(this) and
|
||||
(
|
||||
guard = this.getANullnessNullCheck(_, true)
|
||||
or
|
||||
LogicInput::additionalNullCheck(guard, _, this, true)
|
||||
or
|
||||
guard.isEquality(this, any(Expr n | nullValueImplied(n)), _)
|
||||
or
|
||||
Guards::nullGuard(guard, any(GuardValue v | exists(v.asBooleanValue())), this, true)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user