typedef struct _MonoMethodWrapper MonoMethodWrapper;
typedef struct _MonoMethodInflated MonoMethodInflated;
typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
+typedef struct _MonoDynamicMethod MonoDynamicMethod;
/* Properties that applies to a group of structs should better use a higher number
* to avoid colision with type specific properties.
void *method_data;
};
+struct _MonoDynamicMethod {
+ MonoMethodWrapper method;
+ MonoAssembly *assembly;
+};
+
struct _MonoMethodPInvoke {
MonoMethod method;
gpointer addr;
(rmb->iattrs & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
m = (MonoMethod *)image_g_new0 (image, MonoMethodPInvoke, 1);
else
- m = (MonoMethod *)image_g_new0 (image, MonoMethodWrapper, 1);
+ m = (MonoMethod *)image_g_new0 (image, MonoDynamicMethod, 1);
wrapperm = (MonoMethodWrapper*)m;
}
wrapperm->header = header;
+ MonoDynamicMethod *dm = (MonoDynamicMethod*)wrapperm;
+ dm->assembly = klass->image->assembly;
}
if (rmb->generic_params) {
rmb.refs [i + 1] = handle_class;
}
+ MonoAssembly *ass = NULL;
if (mb->owner) {
MonoType *owner_type = mono_reflection_type_get_handle ((MonoReflectionType*)mb->owner, error);
if (!is_ok (error)) {
return FALSE;
}
klass = mono_class_from_mono_type (owner_type);
+ ass = klass->image->assembly;
} else {
klass = mono_defaults.object_class;
+ ass = (mb->module && mb->module->image) ? mb->module->image->assembly : NULL;
}
mb->mhandle = handle = reflection_methodbuilder_to_mono_method (klass, &rmb, sig, error);
+ ((MonoDynamicMethod*)handle)->assembly = ass;
g_free (rmb.refs);
return_val_if_nok (error, FALSE);
int i;
gboolean val = FALSE;
+ if (m->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD) {
+ MonoDynamicMethod *dm = (MonoDynamicMethod *)m;
+ if (dm->assembly)
+ ass = dm->assembly;
+ }
g_assert (ass);
if (ass->wrap_non_exception_throws_inited)
return ass->wrap_non_exception_throws;