@@ -119,14 +119,14 @@ private module GuardsInput implements
119119 class AndExpr extends BinExpr {
120120 AndExpr ( ) {
121121 this instanceof LogicalAndExpr or
122- this instanceof BitwiseAndExpr
122+ this instanceof BitwiseAndOperation
123123 }
124124 }
125125
126126 class OrExpr extends BinExpr {
127127 OrExpr ( ) {
128128 this instanceof LogicalOrExpr or
129- this instanceof BitwiseOrExpr
129+ this instanceof BitwiseOrOperation
130130 }
131131 }
132132
@@ -292,7 +292,7 @@ private module LogicInput implements GuardsImpl::LogicInputSig {
292292 v1 .isNonNullValue ( ) and
293293 v2 = v1
294294 or
295- g2 = g1 .( NullCoalescingExpr ) .getAnOperand ( ) and
295+ g2 = g1 .( NullCoalescingOperation ) .getAnOperand ( ) and
296296 v1 .isNullValue ( ) and
297297 v2 = v1
298298 or
@@ -840,14 +840,14 @@ module Internal {
840840 or
841841 e1 = e2 .( Cast ) .getExpr ( )
842842 or
843- e2 = e1 .( NullCoalescingExpr ) .getAnOperand ( )
843+ e2 = e1 .( NullCoalescingOperation ) .getAnOperand ( )
844844 }
845845
846846 /** Holds if expression `e3` is a `null` value whenever `e1` and `e2` are. */
847847 predicate nullValueImpliedBinary ( Expr e1 , Expr e2 , Expr e3 ) {
848848 e3 = any ( ConditionalExpr ce | e1 = ce .getThen ( ) and e2 = ce .getElse ( ) )
849849 or
850- e3 = any ( NullCoalescingExpr nce | e1 = nce .getLeftOperand ( ) and e2 = nce .getRightOperand ( ) )
850+ e3 = any ( NullCoalescingOperation no | e1 = no .getLeftOperand ( ) and e2 = no .getRightOperand ( ) )
851851 }
852852
853853 predicate nullValueImplied ( Expr e ) {
@@ -907,7 +907,7 @@ module Internal {
907907 or
908908 // "In string concatenation operations, the C# compiler treats a null string the same as an empty string."
909909 // (https://docs.microsoft.com/en-us/dotnet/csharp/how-to/concatenate-multiple-strings)
910- e instanceof AddExpr and
910+ e instanceof AddOperation and
911911 e .getType ( ) instanceof StringType
912912 or
913913 e .( DefaultValueExpr ) .getType ( ) .isValueType ( )
@@ -922,11 +922,9 @@ module Internal {
922922
923923 /** Holds if expression `e2` is a non-`null` value whenever `e1` is. */
924924 predicate nonNullValueImpliedUnary ( Expr e1 , Expr e2 ) {
925- e1 = e2 .( CastExpr ) .getExpr ( )
926- or
927- e1 = e2 .( AssignExpr ) .getRValue ( )
928- or
929- e1 = e2 .( NullCoalescingExpr ) .getAnOperand ( )
925+ e1 = e2 .( CastExpr ) .getExpr ( ) or
926+ e1 = e2 .( AssignExpr ) .getRValue ( ) or
927+ e1 = e2 .( NullCoalescingOperation ) .getAnOperand ( )
930928 }
931929
932930 /**
@@ -953,10 +951,13 @@ module Internal {
953951 )
954952 or
955953 // In C#, `null + 1` has type `int?` with value `null`
956- exists ( BinaryArithmeticOperation bao , Expr o |
957- result = bao and
958- bao .getAnOperand ( ) = e and
959- bao .getAnOperand ( ) = o and
954+ exists ( BinaryOperation bo , Expr o |
955+ bo instanceof BinaryArithmeticOperation or
956+ bo instanceof AssignArithmeticOperation
957+ |
958+ result = bo and
959+ bo .getAnOperand ( ) = e and
960+ bo .getAnOperand ( ) = o and
960961 // The other operand must be provably non-null in order
961962 // for `only if` to hold
962963 nonNullValueImplied ( o ) and
@@ -972,10 +973,10 @@ module Internal {
972973 any ( QualifiableExpr qe |
973974 qe .isConditional ( ) and
974975 result = qe .getQualifier ( )
975- )
976- or
976+ ) or
977977 // In C#, `null + 1` has type `int?` with value `null`
978- e = any ( BinaryArithmeticOperation bao | result = bao .getAnOperand ( ) )
978+ e = any ( BinaryArithmeticOperation bao | result = bao .getAnOperand ( ) ) or
979+ e = any ( AssignArithmeticOperation aao | result = aao .getAnOperand ( ) )
979980 }
980981
981982 deprecated predicate isGuard ( Expr e , GuardValue val ) {
0 commit comments