Revert "proxy injector: ctors already have void return type"

This reverts commit e9e448cbdc.
This commit is contained in:
JohnCorby 2022-02-13 17:51:53 -08:00
parent 8e04eca8bc
commit 19d8a978a3

View File

@ -41,7 +41,7 @@ namespace ProxyInjector
var proxyTd = new TypeDefinition(td.Namespace, "PROXY_" + td.Name, td.Attributes, qsbModule.ImportReference(td));
var ctor = td.Methods.First(md => md.Name == ".ctor" && !md.HasParameters);
var proxyCtor = new MethodDefinition(ctor.Name, ctor.Attributes, qsbModule.TypeSystem.Void);
var proxyCtor = new MethodDefinition(ctor.Name, ctor.Attributes, qsbModule.ImportReference(ctor.ReturnType));
proxyCtor.Body = new MethodBody(proxyCtor);
proxyCtor.Body.Instructions.Add(Instruction.Create(OpCodes.Ldarg_0));
proxyCtor.Body.Instructions.Add(Instruction.Create(OpCodes.Call, qsbModule.ImportReference(ctor)));