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

proxy-super broken #43

Open
mbrezu opened this issue Dec 29, 2009 · 0 comments
Open

proxy-super broken #43

mbrezu opened this issue Dec 29, 2009 · 0 comments

Comments

@mbrezu
Copy link

mbrezu commented Dec 29, 2009

proxy-super is broken (calling the base method from the proxy code calls the proxy method for virtual methods).

Cause: replacement of gen.Emit(OpCodes.Call... with ILGen.EmitCall, which emits callvirt if the method is a virtual one.

Proposed fix:
diff --git a/Clojure/Clojure/CljCompiler/GenProxy.cs b/Clojure/Clojure/CljCompiler/GenProxy.cs
index fab6352..7f4b0d8 100644
--- a/Clojure/Clojure/CljCompiler/GenProxy.cs
+++ b/Clojure/Clojure/CljCompiler/GenProxy.cs
@@ -320,7 +320,7 @@ namespace clojure.lang
gen.EmitLoadArg(0); // gen.Emit(OpCodes.Ldarg_0);
for (int i = 0; i < parmCount; i++)
gen.EmitLoadArg(i + 1); // gen.Emit(OpCodes.Ldarg, i + 1);
- gen.EmitCall(m); // gen.Emit(OpCodes.Call, m);
+ gen.Emit(OpCodes.Call, m);
}
else
{

(line 323 in GenProxy.cs)

Maybe there are other related issues - using ILGen.EmitCall isn't the same as Emit(OpCodes.Call...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant