Author: martin
Date: 2005-07-01 15:27:59 -0400 (Fri, 01 Jul 2005)
New Revision: 46858

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/reflection.c
Log:
2005-07-01  Martin Baulig  <[EMAIL PROTECTED]>

        * reflection.c (mono_reflection_generic_class_initialize): Update
        the `dgclass->fields [i].parent' to the correct class.
        (mono_image_get_fieldref_token): Use the declaring type, not the
        reflected type.



Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2005-07-01 19:26:41 UTC (rev 46857)
+++ trunk/mono/mono/metadata/ChangeLog  2005-07-01 19:27:59 UTC (rev 46858)
@@ -5,6 +5,13 @@
 
 2005-07-01  Martin Baulig  <[EMAIL PROTECTED]>
 
+       * reflection.c (mono_reflection_generic_class_initialize): Update
+       the `dgclass->fields [i].parent' to the correct class.
+       (mono_image_get_fieldref_token): Use the declaring type, not the
+       reflected type.
+
+2005-07-01  Martin Baulig  <[EMAIL PROTECTED]>
+
        * loader.c (find_method): Also look in the interfaces; fixes #75429.
 
 2005-06-30  Ben Maurer  <[EMAIL PROTECTED]>

Modified: trunk/mono/mono/metadata/reflection.c
===================================================================
--- trunk/mono/mono/metadata/reflection.c       2005-07-01 19:26:41 UTC (rev 
46857)
+++ trunk/mono/mono/metadata/reflection.c       2005-07-01 19:27:59 UTC (rev 
46858)
@@ -2388,7 +2388,7 @@
                return token;
        g_assert (f->field->parent);
        type = f->field->generic_info ? f->field->generic_info->generic_type : 
f->field->type;
-       token = mono_image_get_memberref_token (assembly, &f->klass->byval_arg, 
+       token = mono_image_get_memberref_token (assembly, 
&f->field->parent->byval_arg, 
                f->field->name,  fieldref_encode_signature (assembly, type));
        g_hash_table_insert (assembly->handleref, f, GUINT_TO_POINTER(token));
        return token;
@@ -4181,7 +4181,7 @@
                /*g_print ("got token 0x%08x for %s\n", token, 
m->method->name);*/
        } else if (strcmp (klass->name, "MonoField") == 0) {
                MonoReflectionField *f = (MonoReflectionField *)obj;
-               if ((f->klass->image == &assembly->image) && 
!f->field->generic_info) {
+               if ((f->field->parent->image == &assembly->image) && 
!f->field->generic_info) {
                        static guint32 field_table_idx = 0xffffff;
                        field_table_idx --;
                        token = MONO_TOKEN_FIELD_DEF | field_table_idx;
@@ -8904,6 +8904,7 @@
                ifield->reflection_info = obj;
 
                dgclass->fields [i] = *field;
+               dgclass->fields [i].parent = klass;
                dgclass->fields [i].generic_info = ifield;
                dgclass->fields [i].type = mono_class_inflate_generic_type 
(field->type, gclass->context);
        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to