mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Java: Reinstate useless null check results for fields that are no longer tracked as SSA variables.
This commit is contained in:
@@ -105,6 +105,13 @@ Expr clearlyNotNullExpr(Expr reason) {
|
||||
result = v.getARead() and
|
||||
not result = baseNotNullExpr()
|
||||
)
|
||||
or
|
||||
exists(Field f |
|
||||
result = f.getAnAccess() and
|
||||
f.isFinal() and
|
||||
f.getInitializer() = clearlyNotNullExpr(reason) and
|
||||
not result = baseNotNullExpr()
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if `v` is an SSA variable that is provably not `null`. */
|
||||
|
||||
Reference in New Issue
Block a user