Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method analyzer doesn't locate override implementations when layered #198

Open
0xInception opened this issue Sep 2, 2021 · 0 comments
Open
Labels
bug workspaces Issues related to the Workspaces extensions of AsmResolver

Comments

@0xInception
Copy link

Describe the bug

Using feature/workspaces DotNetWorkspace to analyze an abstract method should find all of the direct implementations, but only looks for types that implement the abstract method's declaring type.

To Reproduce

using System;
using System.Linq;
using AsmResolver.DotNet;
using AsmResolver.Workspaces.DotNet;

var path = "Issue.dll";
var module = ModuleDefinition.FromFile(path);

var workspace = new DotNetWorkspace();
workspace.Assemblies.Add(module.Assembly);
workspace.Analyze();

var type = module.TopLevelTypes.First(d=>d.Name == "TestAbstractClass");
var method = type.Methods.First(d => d.Name == "TestAbstractBool");
            
var node = workspace.Index.GetOrCreateNode(method);
var impls = node.BackwardRelations.GetObjects(DotNetRelations.ImplementationMethod).ToArray();
foreach (var impl in impls)
{
   Console.WriteLine(impl.DeclaringType.Name);
}
Console.WriteLine(impls.Length == 3);

Issue.zip

Proposal

Should perhaps look recursively for the types that implement the abstract method's declaring type

Screenshots

2021-09-02_23-15

Platform

  • OS: Linux
  • AsmResolver Version: feature/workspaces branch
@0xInception 0xInception added the bug label Sep 2, 2021
@Washi1337 Washi1337 added the workspaces Issues related to the Workspaces extensions of AsmResolver label Sep 2, 2021
JPaja added a commit to JPaja/AsmResolver that referenced this issue Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug workspaces Issues related to the Workspaces extensions of AsmResolver
Projects
None yet
Development

No branches or pull requests

2 participants