2003-09-07 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Sun, 7 Sep 2003 14:59:09 +0000 (14:59 -0000)
committerMartin Baulig <martin@novell.com>
Sun, 7 Sep 2003 14:59:09 +0000 (14:59 -0000)
* class.c (mono_class_init): If we're a generic instance, inflate
all our methods instead of loading them from the image.
(mono_class_from_generic): Set `class->methods = gklass->methods'.

svn path=/trunk/mono/; revision=17970

mono/metadata/ChangeLog
mono/metadata/class.c

index f82c7fd5cd7814b48b5c458d0235efcfe2a5c723..b1d434214856b2867894ceaa26e1ead8387388b5 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-07  Martin Baulig  <martin@ximian.com>
+
+       * class.c (mono_class_init): If we're a generic instance, inflate
+       all our methods instead of loading them from the image.
+       (mono_class_from_generic): Set `class->methods = gklass->methods'.
+
 2003-09-07  Martin Baulig  <martin@ximian.com>
 
        * mono-debug-debugger.c: Added support for constructors.
index 2db15f3b056eb4c144a3ad18ead579460b6d3932..3dfa9d05c8ed388fcc94fd2a98b3c840fb2253ab 100644 (file)
@@ -1142,17 +1142,18 @@ mono_class_init (MonoClass *class)
                        class->methods [1] = ctor;
                }
        } else {
-               class->methods = g_new (MonoMethod*, class->method.count);
-               for (i = 0; i < class->method.count; ++i) {
-                       class->methods [i] = mono_get_method (class->image,
-                               MONO_TOKEN_METHOD_DEF | (i + class->method.first + 1), class);
-               }
                if (class->generic_inst) {
                        for (i = 0; i < class->method.count; ++i) {
                                class->methods [i] = inflate_generic_method (class->methods [i], class->generic_inst->data.generic_inst, NULL);
                                class->methods [i]->klass = class;
                                /*g_print ("inflated method %s in %s\n", class->methods [i]->name, class->name);*/
                        }
+               } else {
+                       class->methods = g_new (MonoMethod*, class->method.count);
+                       for (i = 0; i < class->method.count; ++i) {
+                               class->methods [i] = mono_get_method (class->image,
+                                                                     MONO_TOKEN_METHOD_DEF | (i + class->method.first + 1), class);
+                       }
                }
        }
 
@@ -1613,6 +1614,7 @@ mono_class_from_generic (MonoType *gtype)
 
        class->field = gklass->field;
        class->method = gklass->method;
+       class->methods = gklass->methods;
 
        /*g_print ("instantiating class from %s.%s to %s\n", gklass->name_space, gklass->name, class->name);
        g_print ("methods: %d, fields: %d\n", class->method.count, class->field.count);*/