Ejemplo n.º 1
0
        protected override IEnumerable <InstructionNode> GetDataflowBackRelatedArgGroup(InstructionNode instNode)
        {
            LocationLoadInstructionNode ldInstNode           = (LocationLoadInstructionNode)instNode;
            Predicate <InstructionNode> nodeIsARelevantStloc = x => x is LocationStoreInstructionNode &&
                                                               ((LocationStoreInstructionNode)x).LocIndex == ldInstNode.LocIndex &&
                                                               x.Method == instNode.Method;
            Predicate <InstructionNode> nodeIsARelevantStind = x => x is StIndInstructionNode &&
                                                               ((StIndInstructionNode)x).AddressProvidingArgs.Any(y => new[] { Code.Ldloca, Code.Ldloca_S }.Contains(y.Instruction.OpCode.Code) &&
                                                                                                                  ((VariableDefinition)y.Instruction.Operand).Index == ldInstNode.LocIndex &&
                                                                                                                  y.Method == instNode.Method);

            bool allPathsHaveANode;

            return(SingleIndexBackSearcher.SafeSearchBackwardsForDataflowInstrcutions(x => nodeIsARelevantStloc(x) || nodeIsARelevantStind(x), instNode, out allPathsHaveANode));
        }
Ejemplo n.º 2
0
        protected override IEnumerable <InstructionNode> GetDataflowBackRelatedArgGroup(InstructionNode instWrapper)
        {
            bool allPathsFoundAMatch;

            return(SingleIndexBackSearcher.SafeSearchBackwardsForDataflowInstrcutions(x => x.Instruction.OpCode.Code == Code.Mkrefany, instWrapper, out allPathsFoundAMatch));
        }