Exemplo n.º 1
0
 public CallInfo(int instructionIndex, MethodDef methodDef, ICollection <MethodDef> cachedOverrides = null)
     : this(instructionIndex, methodDef,
            CreateAssemblyInfo(methodDef),
            methodDef.CreateMethodUniqueSignature(),
            methodDef.IsPublicGlobalVisibility(),
            (cachedOverrides ?? methodDef.FindOverrides()).Select(md => md.CreateMethodUniqueSignature()).ToList())
 {
 }
Exemplo n.º 2
0
        private void AddImplementations(MethodDef method, ICollection <MethodDef> cachedOverrides = null)
        {
            foreach (var baseMethod in cachedOverrides ?? method.FindOverrides())
            {
                var baseSignature = baseMethod.CreateMethodUniqueSignature();
                if (!implementations.TryGetValue(baseSignature, out var implList))
                {
                    implList = new HashSet <MethodDef>();
                    implementations.Add(baseSignature, implList);
                }

                var added = implList.Add(method);
                //Debug.Assert(added);  //it happens when 2 same libraries loaded from different directories
                //e.g., I copied few .NET FW libs to separate folder
                //to analyze entry points from these libs only
            }
        }