Dont assert on invalid delegate type.
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 28 Jul 2010 19:14:39 +0000 (16:14 -0300)
committerRodrigo Kumpera <kumpera@gmail.com>
Wed, 28 Jul 2010 19:14:39 +0000 (16:14 -0300)
2010-07-28 Rodrigo Kumpera  <rkumpera@novell.com>

* object.c (mono_get_delegate_invoke): Don't assert if
the Invoke method is not found. This can happen with
broken types and it's the caller resposibility to deal
with a null return.

Fixes #553403

mono/metadata/ChangeLog
mono/metadata/object.c

index fa07ec1bfb14e97ee414713c247fa026e4f9a28e..cdaf12e9ce90011c2ac6703489eff4a5578a86e2 100644 (file)
@@ -1,3 +1,12 @@
+2010-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * object.c (mono_get_delegate_invoke): Don't assert if
+       the Invoke method is not found. This can happen with
+       broken types and it's the caller resposibility to deal
+       with a null return.
+
+       Fixes #553403
+
 2010-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * class.c (mono_assembly_name_from_token): Handle
index d6e24e8ab6fbc29bf9accae908d1f1e72f03233b..0eb1c1a9ee8a737ba8d9005824a6cfb46d21cf19 100644 (file)
@@ -3275,7 +3275,7 @@ mono_nullable_box (guint8 *buf, MonoClass *klass)
  * mono_get_delegate_invoke:
  * @klass: The delegate class
  *
- * Returns: the MonoMethod for the "Invoke" method in the delegate klass
+ * Returns: the MonoMethod for the "Invoke" method in the delegate klass or NULL if @klass is a broken delegate type
  */
 MonoMethod *
 mono_get_delegate_invoke (MonoClass *klass)
@@ -3287,8 +3287,6 @@ mono_get_delegate_invoke (MonoClass *klass)
        if (klass->exception_type)
                return NULL;
        im = mono_class_get_method_from_name (klass, "Invoke", -1);
-       g_assert (im);
-
        return im;
 }