Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfrijters <jfrijters>2011-12-08 17:47:07 +0400
committerjfrijters <jfrijters>2011-12-08 17:47:07 +0400
commitceba3c78344984406216fa04bae704b927b9c1cc (patch)
tree2326d8ba1d38f28a515a271edf25816d8afb5735
parent8a99a6043042bdeb64d89e87876edee2c63a2272 (diff)
Generate override stub for miranda method, when necessary.
-rw-r--r--runtime/DynamicTypeWrapper.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/DynamicTypeWrapper.cs b/runtime/DynamicTypeWrapper.cs
index 72724b59..08e0d7cd 100644
--- a/runtime/DynamicTypeWrapper.cs
+++ b/runtime/DynamicTypeWrapper.cs
@@ -2648,16 +2648,21 @@ namespace IKVM.Internal
string name = GenerateUniqueMethodName(methods[index].Name, baseMethods[index][0]);
MethodBuilder mb = methods[index].GetDefineMethodHelper().DefineMethod(wrapper, name, MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.Abstract | MethodAttributes.CheckAccessOnOverride);
AttributeHelper.HideFromReflection(mb);
+ bool overridestub = CheckRequireOverrideStub(methods[index], baseMethods[index][0]);
#if STATIC_COMPILER
- if (CheckRequireOverrideStub(methods[index], baseMethods[index][0]) || name != methods[index].Name)
+ if (overridestub || name != methods[index].Name)
{
// instead of creating an override stub, we created the Miranda method with the proper signature and
// decorate it with a NameSigAttribute that contains the real signature
AttributeHelper.SetNameSig(mb, methods[index].Name, methods[index].Signature);
}
#endif // STATIC_COMPILER
+ if (overridestub)
+ {
+ GenerateUnloadableOverrideStub(wrapper, typeBuilder, baseMethods[index][0], mb, methods[index].ReturnTypeForDefineMethod, methods[index].GetParametersForDefineMethod());
+ }
// if we changed the name or if the interface method name is remapped, we need to add an explicit methodoverride.
- if (!baseMethods[index][0].IsDynamicOnly && name != baseMethods[index][0].RealName)
+ else if (!baseMethods[index][0].IsDynamicOnly && name != baseMethods[index][0].RealName)
{
typeBuilder.DefineMethodOverride(mb, (MethodInfo)baseMethods[index][0].GetMethod());
}