@@ -80,9 +80,7 @@ class AlwaysNullExpr extends Expr {
8080}
8181
8282/** Holds if SSA definition `def` is always `null`. */
83- private predicate nullDef ( Ssa:: ExplicitDefinition def ) {
84- def .getADefinition ( ) .getSource ( ) instanceof AlwaysNullExpr
85- }
83+ private predicate nullDef ( SsaExplicitWrite def ) { def .getValue ( ) instanceof AlwaysNullExpr }
8684
8785/** An expression that is never `null`. */
8886class NonNullExpr extends Expr {
@@ -108,10 +106,10 @@ class NonNullExpr extends Expr {
108106}
109107
110108/** Holds if SSA definition `def` is never `null`. */
111- private predicate nonNullDef ( Ssa :: ExplicitDefinition def ) {
112- def .getADefinition ( ) . getSource ( ) instanceof NonNullExpr
109+ private predicate nonNullDef ( SsaExplicitWrite def ) {
110+ def .getValue ( ) instanceof NonNullExpr
113111 or
114- exists ( AssignableDefinition ad | ad = def .getADefinition ( ) |
112+ exists ( AssignableDefinition ad | ad = def .getDefinition ( ) |
115113 ad instanceof AssignableDefinitions:: PatternDefinition
116114 or
117115 ad =
@@ -201,7 +199,7 @@ private predicate defMaybeNull(SsaDefinition def, ControlFlowNode node, string m
201199 not de = any ( Ssa:: PhiNode phi ) .getARead ( ) and
202200 // Don't use a check as reason if there is a `null` assignment
203201 // or argument
204- not def .( Ssa :: ExplicitDefinition ) . getADefinition ( ) . getSource ( ) instanceof MaybeNullExpr and
202+ not def .( SsaExplicitWrite ) . getValue ( ) instanceof MaybeNullExpr and
205203 not isMaybeNullArgument ( def , _)
206204 )
207205 or
@@ -219,7 +217,7 @@ private predicate defMaybeNull(SsaDefinition def, ControlFlowNode node, string m
219217 msg = "because the parameter has a null default value"
220218 or
221219 // If the source of a variable is `null` then the variable may be `null`
222- exists ( AssignableDefinition adef | adef = def .( Ssa :: ExplicitDefinition ) . getADefinition ( ) |
220+ exists ( AssignableDefinition adef | adef = def .( SsaExplicitWrite ) . getDefinition ( ) |
223221 adef .getSource ( ) = maybeNullExpr ( node .asExpr ( ) ) and
224222 reason = adef .getExpr ( ) and
225223 msg = "because of $@ assignment"
@@ -351,7 +349,7 @@ class Dereference extends G::DereferenceableExpr {
351349
352350 private predicate isAlwaysNull0 ( SsaDefinition def ) {
353351 forall ( SsaDefinition input | input = getAnUltimateDefinition ( def ) |
354- input .( Ssa :: ExplicitDefinition ) . getADefinition ( ) . getSource ( ) instanceof AlwaysNullExpr
352+ input .( SsaExplicitWrite ) . getValue ( ) instanceof AlwaysNullExpr
355353 ) and
356354 not nonNullDef ( def ) and
357355 this = def .getARead ( ) and
0 commit comments