@@ -123,11 +123,10 @@ class IgnorableExpr48Mapping extends IgnorableOperation {
123123 */
124124class IgnorableCharLiteralArithmetic extends IgnorableOperation {
125125 IgnorableCharLiteralArithmetic ( ) {
126- exists ( this .( BinaryArithmeticOperation ) .getAnOperand ( ) . ( TextLiteral ) . getValue ( ) )
126+ this .( BinaryArithmeticOperation ) .getAnOperand ( ) instanceof TextLiteral
127127 or
128- exists ( AssignArithmeticOperation e | e .getRValue ( ) = this |
129- exists ( this .( TextLiteral ) .getValue ( ) )
130- )
128+ this instanceof TextLiteral and
129+ any ( AssignArithmeticOperation arith ) .getRValue ( ) = this
131130 }
132131}
133132
@@ -214,11 +213,10 @@ class OperationAsArgToIgnorableFunction extends IgnorableOperation {
214213 * and the operation is basically ignorable (it's not a real operation but
215214 * probably one visual simplicity what it means).
216215 */
217- class ConstantBinaryArithmeticOperation extends IgnorableOperation {
216+ class ConstantBinaryArithmeticOperation extends IgnorableOperation , BinaryArithmeticOperation {
218217 ConstantBinaryArithmeticOperation ( ) {
219- this instanceof BinaryArithmeticOperation and
220- this .( BinaryArithmeticOperation ) .getLeftOperand ( ) instanceof Literal and
221- this .( BinaryArithmeticOperation ) .getRightOperand ( ) instanceof Literal
218+ this .getLeftOperand ( ) instanceof Literal and
219+ this .getRightOperand ( ) instanceof Literal
222220 }
223221}
224222
@@ -274,7 +272,10 @@ class IgnorablePointerOrCharArithmetic extends IgnorableOperation {
274272 */
275273predicate isOperationSourceCandidate ( Expr e ) {
276274 not e instanceof IgnorableOperation and
277- not e .getEnclosingFunction ( ) instanceof IgnorableFunction and
275+ exists ( Function f |
276+ f = e .getEnclosingFunction ( ) and
277+ not f instanceof IgnorableFunction
278+ )
278279 (
279280 e instanceof SubExpr
280281 or
@@ -494,7 +495,9 @@ class MonthEqualityCheck extends EqualityOperation {
494495 }
495496}
496497
497- class MonthEqualityCheckGuard extends GuardCondition instanceof MonthEqualityCheck { }
498+ final class FinalMonthEqualityCheck = MonthEqualityCheck ;
499+
500+ class MonthEqualityCheckGuard extends GuardCondition , FinalMonthEqualityCheck { }
498501
499502/**
500503 * Verifies if the expression is guarded by a check on the Month property of a date struct, that is NOT February.
@@ -504,7 +507,7 @@ pragma[inline_late]
504507predicate isControlledByMonthEqualityCheckNonFebruary ( Expr e ) {
505508 exists ( MonthEqualityCheckGuard monthGuard |
506509 monthGuard .controls ( e .getBasicBlock ( ) , true ) and
507- not monthGuard .( MonthEqualityCheck ) . getExprCompared ( ) .getValueText ( ) = "2"
510+ not monthGuard .getExprCompared ( ) .getValueText ( ) = "2"
508511 )
509512}
510513
0 commit comments