Author: zoltan
Date: 2005-04-12 12:26:56 -0400 (Tue, 12 Apr 2005)
New Revision: 42840

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/class.c
Log:
2005-04-12  Zoltan Varga  <[EMAIL PROTECTED]>

        * class.c (class_compute_field_layout): Fix the regression caused by
        the previous try.


Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2005-04-12 16:12:38 UTC (rev 42839)
+++ trunk/mono/mono/metadata/ChangeLog  2005-04-12 16:26:56 UTC (rev 42840)
@@ -1,3 +1,8 @@
+2005-04-12  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * class.c (class_compute_field_layout): Fix the regression caused by
+       the previous try.
+
 2005-04-12 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * threadpool.c: separate pool for socket async. IO.

Modified: trunk/mono/mono/metadata/class.c
===================================================================
--- trunk/mono/mono/metadata/class.c    2005-04-12 16:12:38 UTC (rev 42839)
+++ trunk/mono/mono/metadata/class.c    2005-04-12 16:26:56 UTC (rev 42840)
@@ -530,7 +530,7 @@
        gboolean explicit_size;
        MonoClassField *field;
 
-       if (class->fields)
+       if (class->size_inited)
                return;
 
        if (class->parent) {
@@ -567,6 +567,9 @@
        if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT)
                blittable = FALSE;
 
+       /* Prevent infinite loops if the class references itself */
+       class->size_inited = 1;
+
        class->fields = g_new0 (MonoClassField, top);
 
        /*

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

Reply via email to