Skip to content

proxy-super broken #43

@mbrezu

Description

@mbrezu

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...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions