Beispiel #1
0
 private bool ShareNonObjectArgs(LoadFieldNode loadFieldNode)
 {
     if (this._FieldDefinition.MetadataToken != _FieldDefinition.MetadataToken)
     {
         return(false);
     }
     return(true);
 }
Beispiel #2
0
        public override bool IsLoadNodeMatching(InstructionNode loadNode)
        {
            LoadFieldNode loadFieldNode = loadNode as LoadFieldNode;

            if (loadFieldNode == null)
            {
                return(false);
            }
            //TOOD comparing strings is not great
            if (loadFieldNode.FieldDefinition.Name != _FieldDefinition.Name)
            {
                return(false);
            }
            var loadFieldObjectNodes = loadFieldNode.DataFlowBackRelated.Where(x => x.ArgIndex == 0).SelectMany(x => x.Argument.GetDataOriginNodes());
            var currentLoadNodes     = StoreNode.DataFlowBackRelated.Where(x => x.ArgIndex == 0).SelectMany(x => x.Argument.GetDataOriginNodes());

            if (!loadFieldObjectNodes.Intersect(ObjectNodes).Any())
            {
                return(false);
            }
            return(true);
        }