2010-06-28 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Mon, 28 Jun 2010 22:28:27 +0000 (22:28 -0000)
committerZoltan Varga <vargaz@gmail.com>
Mon, 28 Jun 2010 22:28:27 +0000 (22:28 -0000)
* class.c (mono_class_get_vtable_entry): Avoid a crash if mono_class_setup_vtable ()
fails.

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

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

index bcd29b7eab76c8d533c917d5458f44b629351396..d1899d108b026b7d336febcab60a550b9fafc7e6 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-28  Zoltan Varga  <vargaz@gmail.com>
+
+       * class.c (mono_class_get_vtable_entry): Avoid a crash if mono_class_setup_vtable ()
+       fails.
+
 2010-06-25  Mark Probst  <mark.probst@gmail.com>
 
        * class.c (mono_class_inflate_generic_method_full_checked): Added
index cd33294c74dbcff8e5f5d534dd7e01527bb2f9be..153ca4a2ef80e5d4c927342b462a656c4ce760e6 100644 (file)
@@ -2029,7 +2029,7 @@ mono_class_get_inflated_method (MonoClass *class, MonoMethod *method)
 /*
  * mono_class_get_vtable_entry:
  *
- *   Returns class->vtable [offset], computing it if neccesary.
+ *   Returns class->vtable [offset], computing it if neccesary. Returns NULL on failure.
  * LOCKING: Acquires the loader lock.
  */
 MonoMethod*
@@ -2055,6 +2055,8 @@ mono_class_get_vtable_entry (MonoClass *class, int offset)
                m = mono_class_inflate_generic_method_full (m, class, mono_class_get_context (class));
        } else {
                mono_class_setup_vtable (class);
+               if (class->exception_type)
+                       return NULL;
                m = class->vtable [offset];
        }