Example #1
0
        internal static ProgramState SetConstraintOnValueEquals(ValueEqualsSymbolicValue equals,
                                                                ProgramState programState)
        {
            if (equals.LeftOperand == equals.RightOperand)
            {
                return(equals.SetConstraint(BoolConstraint.True, programState));
            }

            return(programState);
        }
Example #2
0
        private ProgramState HandleStaticEqualsCall()
        {
            SymbolicValue arg1;
            SymbolicValue arg2;

            var newProgramState = programState
                                  .PopValue(out arg1)
                                  .PopValue(out arg2)
                                  .PopValue();

            var equals = new ValueEqualsSymbolicValue(arg1, arg2);

            newProgramState = newProgramState.PushValue(equals);
            return(SetConstraintOnValueEquals(equals, newProgramState));
        }
Example #3
0
        private ProgramState HandleInstanceEqualsCall()
        {
            SymbolicValue arg1;
            SymbolicValue expression;

            var newProgramState = programState
                                  .PopValue(out arg1)
                                  .PopValue(out expression);

            var memberAccess = expression as MemberAccessSymbolicValue;

            SymbolicValue arg2 = memberAccess != null
                ? memberAccess.MemberExpression
                : SymbolicValue.This;

            var equals = new ValueEqualsSymbolicValue(arg1, arg2);

            newProgramState = newProgramState.PushValue(equals);
            return(SetConstraintOnValueEquals(equals, newProgramState));
        }