Exemplo n.º 1
0
        /// <summary>
        /// Visits a jump statement point
        /// </summary>
        /// <param name="p">point to visit</param>
        public override void VisitJump(JumpStmtPoint p)
        {
            _currentPoint = p;
            switch (p.Jump.Type)
            {
            case JumpStmt.Types.Return:
                var returnVar = Output.GetLocalControlVariable(SnapshotBase.ReturnValue);

                /*var returnValue = p.Expression.Value.ReadMemory(Input);
                 * returnVar.WriteMemory(Output, returnValue);*/

                if (p.Expression != null)
                {
                    var              varID          = getVariableIdentifier(p.Expression.Value);
                    List <Value>     possibleValues = new List <Value>(p.Expression.Value.ReadMemory(p.Expression.OutSnapshot).PossibleValues);
                    List <ValueInfo> values         = new List <ValueInfo>();
                    values.Add(new ValueInfo(possibleValues, varID));

                    bool nullValue = hasPossibleNullValue(p.Expression) || hasPossibleNullValue(p.Expression);

                    TaintInfo outputTaint = mergeTaint(values, nullValue);
                    returnVar.WriteMemory(Output, new MemoryEntry(Output.CreateInfo(outputTaint)));
                }

                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 2
0
        public override void VisitJump(JumpStmtPoint p)
        {
            switch (p.Jump.Type)
            {
            case JumpStmt.Types.Return:
                var returnVar   = Output.GetLocalControlVariable(SnapshotBase.ReturnValue);
                var returnValue = p.Expression.Value.ReadMemory(Input);
                returnVar.WriteMemory(Output, returnValue);
                break;

            default:
                throw new NotImplementedException();
            }
        }