Author: jbevain
Date: 2007-09-11 16:50:51 -0400 (Tue, 11 Sep 2007)
New Revision: 85659
Modified:
trunk/mono/mono/metadata/ChangeLog
trunk/mono/mono/metadata/object-internals.h
trunk/mono/mono/metadata/reflection.c
Log:
2007-09-11 Jb Evain <[EMAIL PROTECTED]>
* object-internals.h (MonoReflectionDynamicMethod): add
a `MonoReflectionType *owner` field. The owner is used
* reflection.c:
(mono_reflection_create_dynamic_method): use the owner of the dynamic
method as the class declaring the dynamic method.
(reflection_methodbuilder_from_dynamic_method): copy the owner of the
dynamic method to the declaring type of the methodbuilder.
Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog 2007-09-11 20:34:24 UTC (rev 85658)
+++ trunk/mono/mono/metadata/ChangeLog 2007-09-11 20:50:51 UTC (rev 85659)
@@ -1,3 +1,13 @@
+2007-09-11 Jb Evain <[EMAIL PROTECTED]>
+
+ * object-internals.h (MonoReflectionDynamicMethod): add
+ a `MonoReflectionType *owner` field. The owner is used
+ * reflection.c:
+ (mono_reflection_create_dynamic_method): use the owner of the dynamic
+ method as the class declaring the dynamic method.
+ (reflection_methodbuilder_from_dynamic_method): copy the owner of the
+ dynamic method to the declaring type of the methodbuilder.
+
2007-09-11 Mark Probst <[EMAIL PROTECTED]>
* icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
Modified: trunk/mono/mono/metadata/object-internals.h
===================================================================
--- trunk/mono/mono/metadata/object-internals.h 2007-09-11 20:34:24 UTC (rev
85658)
+++ trunk/mono/mono/metadata/object-internals.h 2007-09-11 20:50:51 UTC (rev
85659)
@@ -1016,6 +1016,7 @@
gint32 nrefs;
MonoArray *refs;
GSList *referenced_by;
+ MonoReflectionType *owner;
} MonoReflectionDynamicMethod;
typedef struct {
Modified: trunk/mono/mono/metadata/reflection.c
===================================================================
--- trunk/mono/mono/metadata/reflection.c 2007-09-11 20:34:24 UTC (rev
85658)
+++ trunk/mono/mono/metadata/reflection.c 2007-09-11 20:50:51 UTC (rev
85659)
@@ -1435,7 +1435,7 @@
rmb->iattrs = 0;
rmb->call_conv = mb->call_conv;
rmb->code = NULL;
- rmb->type = NULL;
+ rmb->type = (MonoObject *) mb->owner;
rmb->name = mb->name;
rmb->table_idx = NULL;
rmb->init_locals = mb->init_locals;
@@ -9456,6 +9456,7 @@
{
ReflectionMethodBuilder rmb;
MonoMethodSignature *sig;
+ MonoClass *klass;
GSList *l;
int i;
@@ -9508,9 +9509,10 @@
rmb.refs [i + 1] = handle_class;
}
- /* FIXME: class */
- mb->mhandle = reflection_methodbuilder_to_mono_method
(mono_defaults.object_class, &rmb, sig);
+ klass = mb->owner ? mono_class_from_mono_type (mb->owner->type) :
mono_defaults.object_class;
+ mb->mhandle = reflection_methodbuilder_to_mono_method (klass, &rmb,
sig);
+
/* Fix up refs entries pointing at us */
for (l = mb->referenced_by; l; l = l->next) {
MonoReflectionDynamicMethod *method =
(MonoReflectionDynamicMethod*)l->data;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches