-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
bugSomething isn't workingSomething isn't workingdotnet-asmresolverIssues related to the .NET back-end powered by AsmResolverIssues related to the .NET back-end powered by AsmResolveremulationIssue related to the emulation modules of Echo.Issue related to the emulation modules of Echo.
Description
When using the new Echo emulator to emulate the following snippet a stack overflow exception is hit when resolving generic parameter types.
public interface ITestInterface<out T, in U> {
public T TestMethod(U u);
}
public class TestClass : ITestInterface<int, long> {
public static ITestInterface<int, long> Instance = new TestClass();
public int TestMethod(long u) {
return (int)u;
}
}
public static class Usage {
public static int Use() {
return TestClass.Instance.TestMethod(long.MaxValue);
}
}Code used to initiate the emulation:
var method = module.GetAllTypes().FirstOrDefault(x => x.Name == "Usage")?.Methods.FirstOrDefault(x => x.Name == "Use");
var vm = new CilVirtualMachine(module, false);
var frame = new CallFrame(method, vm.ValueFactory);
vm.CallStack.Push(frame);
vm.Run();Running this code results in one of the following errors occurring:


Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdotnet-asmresolverIssues related to the .NET back-end powered by AsmResolverIssues related to the .NET back-end powered by AsmResolveremulationIssue related to the emulation modules of Echo.Issue related to the emulation modules of Echo.