Author: miguel
Date: 2006-06-14 23:01:27 -0400 (Wed, 14 Jun 2006)
New Revision: 61738

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/class.c
   trunk/mono/mono/metadata/metadata.c
Log:
2006-06-14  Miguel de Icaza  <[EMAIL PROTECTED]>

        * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
        FALSE on class loading failure instead of returning true.

        * class.c (mono_class_create_from_typedef): It is possible for
        mono_metadata_interfaces_from_typedef_full to fail if a class is
        not found, cope with this.
        

2006-06-14  Dick Porter  <[EMAIL PROTECTED]>

Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2006-06-15 01:00:22 UTC (rev 61737)
+++ trunk/mono/mono/metadata/ChangeLog  2006-06-15 03:01:27 UTC (rev 61738)
@@ -1,3 +1,13 @@
+2006-06-14  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
+       FALSE on class loading failure instead of returning true.
+
+       * class.c (mono_class_create_from_typedef): It is possible for
+       mono_metadata_interfaces_from_typedef_full to fail if a class is
+       not found, cope with this.
+       
+
 2006-06-14  Dick Porter  <[EMAIL PROTECTED]>
 
        * socket-io.c: 

Modified: trunk/mono/mono/metadata/class.c
===================================================================
--- trunk/mono/mono/metadata/class.c    2006-06-15 01:00:22 UTC (rev 61737)
+++ trunk/mono/mono/metadata/class.c    2006-06-15 03:01:27 UTC (rev 61738)
@@ -2877,7 +2877,11 @@
        mono_class_setup_mono_type (class);
 
        if (!class->enumtype) {
-               mono_metadata_interfaces_from_typedef_full (image, type_token, 
&interfaces, &icount, context);
+               if (!mono_metadata_interfaces_from_typedef_full (
+                           image, type_token, &interfaces, &icount, context)){
+                       mono_loader_unlock ();
+                       return NULL;
+               }
 
                class->interfaces = interfaces;
                class->interface_count = icount;

Modified: trunk/mono/mono/metadata/metadata.c
===================================================================
--- trunk/mono/mono/metadata/metadata.c 2006-06-15 01:00:22 UTC (rev 61737)
+++ trunk/mono/mono/metadata/metadata.c 2006-06-15 03:01:27 UTC (rev 61738)
@@ -2781,11 +2781,16 @@
 
        pos = start;
        while (pos < tdef->rows) {
+               MonoClass *iface;
+               
                mono_metadata_decode_row (tdef, pos, cols, 
MONO_INTERFACEIMPL_SIZE);
                if (cols [MONO_INTERFACEIMPL_CLASS] != loc.idx)
                        break;
-               result [pos - start] = mono_class_get_full (
+               iface = mono_class_get_full (
                        meta, mono_metadata_token_from_dor (cols 
[MONO_INTERFACEIMPL_INTERFACE]), context);
+               if (iface == NULL)
+                       return FALSE;
+               result [pos - start] = iface;
                ++pos;
        }
        *count = pos - start;

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

Reply via email to