Пример #1
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            switch (operation)
            {
            case Operations.Identical:
                result = OutSet.CreateBool(false);
                break;

            case Operations.NotIdentical:
                result = OutSet.CreateBool(true);
                break;

            default:
                result = Comparison.AbstractCompare(OutSet, operation);
                if (result != null)
                {
                    break;
                }

                result = BitwiseOperation.Bitwise(OutSet, operation);
                if (result != null)
                {
                    break;
                }

                base.VisitAnyNumericValue(value);
                break;
            }
        }
Пример #2
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            isConcrete = false;

            isNotConvertibleToInteger = false;

            base.VisitAnyNumericValue(value);
        }
Пример #3
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            result = Comparison.AbstractCompare(OutSet, operation);
            if (result != null)
            {
                return;
            }

            base.VisitAnyNumericValue(value);
        }
Пример #4
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            result = ArithmeticOperation.RightAbstractArithmetic(flow, operation, leftOperand.Value);
            if (result != null)
            {
                return;
            }

            base.VisitAnyNumericValue(value);
        }
Пример #5
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            switch (operation)
            {
            case Operations.Mod:
                result = ModuloOperation.AbstractModulo(flow);
                break;

            default:
                base.VisitAnyNumericValue(value);
                break;
            }
        }
Пример #6
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            switch (operation)
            {
            case Operations.Mod:
                // Ommitted warnings messages that objects cannot be converted to integers
                result = ModuloOperation.AbstractModulo(flow);
                break;

            default:
                base.VisitAnyNumericValue(value);
                break;
            }
        }
Пример #7
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            switch (operation)
            {
            default:
                result = Comparison.AbstractCompare(OutSet, operation);
                if (result != null)
                {
                    break;
                }

                base.VisitAnyNumericValue(value);
                break;
            }
        }
Пример #8
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            switch (operation)
            {
            case Operations.Identical:
                result = OutSet.CreateBool(false);
                break;

            case Operations.NotIdentical:
                result = OutSet.CreateBool(true);
                break;

            default:
                base.VisitAnyNumericValue(value);
                break;
            }
        }
Пример #9
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            switch (operation)
            {
            case Operations.Plus:
                result = value;
                break;

            case Operations.LogicNegation:
                result = OutSet.AnyBooleanValue;
                break;

            default:
                base.VisitAnyNumericValue(value);
                break;
            }
        }
Пример #10
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            switch (operation)
            {
            case Operations.Mod:
                result = ModuloOperation.AbstractModulo(flow);
                break;

            default:
                result = Comparison.LeftAlwaysGreater(OutSet, operation);
                if (result != null)
                {
                    break;
                }

                base.VisitAnyNumericValue(value);
                break;
            }
        }
Пример #11
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            // When comparing, both operands are converted to boolean
            switch (operation)
            {
            case Operations.Equal:
            case Operations.NotEqual:
            case Operations.GreaterThanOrEqual:
            case Operations.LessThan:
            case Operations.Or:
            case Operations.Xor:
                result = OutSet.AnyBooleanValue;
                break;

            case Operations.Mod:
                result = ModuloOperation.AbstractModulo(flow);
                break;

            default:
                base.VisitAnyNumericValue(value);
                break;
            }
        }
Пример #12
0
        /// <inheritdoc />
        public override void VisitAnyNumericValue(AnyNumericValue value)
        {
            switch (operation)
            {
            case Operations.Mod:
                result = ModuloOperation.AbstractModulo(flow);
                break;

            default:
                result = Comparison.AbstractCompare(OutSet, operation);
                if (result != null)
                {
                    // Probably since PHP version 5.1.5, Object converts into a number when comparing
                    // with other number. However, since this conversion is undefined, we are comparing
                    // concrete number with abstract number that can result into both true and false
                    SetWarning("Object cannot be converted to integer by comparison",
                               AnalysisWarningCause.OBJECT_CONVERTED_TO_INTEGER);
                    break;
                }

                base.VisitAnyNumericValue(value);
                break;
            }
        }
Пример #13
0
 /// <inheritdoc />
 public override void VisitAnyNumericValue(AnyNumericValue value)
 {
     base.VisitAnyNumericValue(value);
 }
Пример #14
0
 /// <inheritdoc />
 public override void VisitAnyNumericValue(AnyNumericValue value)
 {
     result         = null;
     abstractResult = OutSet.AnyStringValue;
 }