2004-03-13 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Sat, 13 Mar 2004 22:12:36 +0000 (22:12 -0000)
committerMartin Baulig <martin@novell.com>
Sat, 13 Mar 2004 22:12:36 +0000 (22:12 -0000)
* class.h (MonoGenericInst): Added `int count_ifaces'.

* iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
`ginst->count_ifaces' instead `klass->interface_count' since we
may get called before the vtable is created.

* loader.c (mono_method_get_param_names): If we're a generic
instance, return and don't initialize the class.

* reflection.c (mono_reflection_setup_generic_class): Don't call
ensure_runtime_vtable().
(mono_reflection_bind_generic_parameters): Set
`ginst->count_ifaces'.

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

mono/metadata/ChangeLog
mono/metadata/class.h
mono/metadata/icall.c
mono/metadata/loader.c
mono/metadata/reflection.c

index e32e41a6793307d60c085d6dcb7138bc4ac17644..723f5d9334b51811db19cad2616f228e6460b342 100644 (file)
@@ -1,3 +1,19 @@
+2004-03-13  Martin Baulig  <martin@ximian.com>
+
+       * class.h (MonoGenericInst): Added `int count_ifaces'.
+
+       * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
+       `ginst->count_ifaces' instead `klass->interface_count' since we
+       may get called before the vtable is created.
+
+       * loader.c (mono_method_get_param_names): If we're a generic
+       instance, return and don't initialize the class.
+
+       * reflection.c (mono_reflection_setup_generic_class): Don't call
+       ensure_runtime_vtable().
+       (mono_reflection_bind_generic_parameters): Set
+       `ginst->count_ifaces'.
+
 2004-03-11  Jackson Harper <jackson@ximian.com>
 
        * icall.c:
index 78a1953d7eea32955c36cef78c06b5f048e3e286..b01a15b7ca930217629558fe2abe5a14ff818413 100644 (file)
@@ -227,6 +227,7 @@ struct MonoVTable {
 struct _MonoGenericInst {
        MonoClass *klass;
        MonoType *parent;
+       int count_ifaces;
        MonoType **ifaces;
        MonoType *nested_in;
        GList *nested;
index b477ac1a28d1308b257fb8eaa1cafa6f6f585d6a..2162fa9ae5381285d82d72c4669702051660bbd2 100644 (file)
@@ -1819,9 +1819,9 @@ ves_icall_MonoGenericInst_GetInterfaces (MonoReflectionGenericInst *type)
 
        klass = mono_class_from_mono_type (ginst->generic_type);
 
-       res = mono_array_new (domain, System_Reflection_MonoGenericInst, klass->interface_count);
+       res = mono_array_new (domain, System_Reflection_MonoGenericInst, ginst->count_ifaces);
 
-       for (i = 0; i < klass->interface_count; i++) {
+       for (i = 0; i < ginst->count_ifaces; i++) {
                MonoReflectionType *iface = mono_type_get_object (domain, ginst->ifaces [i]);
 
                mono_array_set (res, gpointer, i, iface);
index 7b6083b2e23cf5f3dc0ba2ddcaa1450b0e876a1f..0badc48f0f4a4c7ac573c2d3795fd7cbee2abc03 100644 (file)
@@ -813,11 +813,11 @@ mono_method_get_param_names (MonoMethod *method, const char **names)
        for (i = 0; i < method->signature->param_count; ++i)
                names [i] = "";
 
-       mono_class_init (klass);
-
        if (klass->generic_inst) /* copy the names later */
                return;
 
+       mono_class_init (klass);
+
        if (klass->image->dynamic) {
                MonoReflectionMethodAux *method_aux = 
                        mono_g_hash_table_lookup (
index 259bb02ef9571bb2664e990ea98a30b5d3c4d6b0..6aa4a91108ae3c30673d9ef45cf674f7582c8fe4 100644 (file)
@@ -6470,8 +6470,6 @@ mono_reflection_setup_generic_class (MonoReflectionTypeBuilder *tb)
                MonoReflectionGenericParam *gparam = mono_array_get (tb->generic_params, gpointer, i);
                klass->gen_params [i] = *gparam->type.type->data.generic_param;
        }
-
-       ensure_runtime_vtable (klass);
 }
 
 /*
@@ -6920,6 +6918,7 @@ mono_reflection_bind_generic_parameters (MonoReflectionType *type, int type_argc
        else
                icount = klass->interface_count;
        ginst->ifaces = g_new0 (MonoType *, icount);
+       ginst->count_ifaces = icount;
 
        for (i = 0; i < icount; i++) {
                MonoReflectionType *itype;