+2008-03-16 Zoltan Varga <vargaz@gmail.com>
+
+ * class.c (mono_class_setup_fields): Ignore calls made to this function for
+ classes which are generic instances of not-yet finished typebuilders. Fixes
+ #351172.
+
+ * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
+
2008-03-15 Zoltan Varga <vargaz@gmail.com>
* metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
if (class->size_inited)
return;
+ if (class->generic_class && class->generic_class->container_class->image->dynamic && !class->generic_class->container_class->wastypebuilder) {
+ /*
+ * This happens when a generic instance of an unfinished generic typebuilder
+ * is used as an element type for creating an array type. We can't initialize
+ * the fields of this class using the fields of gklass, since gklass is not
+ * finished yet, fields could be added to it later.
+ */
+ return;
+ }
+
if (class->generic_class) {
MonoClass *gklass = class->generic_class->container_class;
mono_class_setup_fields (gklass);
* tokens for the method with ILGenerator @ilgen.
*/
static void
-fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicImage *assembly) {
+fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicImage *assembly)
+{
guint32 code_idx = GPOINTER_TO_UINT (value);
MonoReflectionILTokenInfo *iltoken;
MonoReflectionFieldBuilder *field;
} else if (!strcmp (iltoken->member->vtable->klass->name, "MethodBuilder") ||
!strcmp (iltoken->member->vtable->klass->name, "ConstructorBuilder")) {
continue;
+ } else if (!strcmp (iltoken->member->vtable->klass->name, "FieldOnTypeBuilderInst")) {
+ continue;
} else {
g_assert_not_reached ();
}