Replace an assert with a nicer check.
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 29 Oct 2010 15:26:28 +0000 (13:26 -0200)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 29 Oct 2010 15:26:28 +0000 (13:26 -0200)
* icall.c (ves_icall_get_method_info): Use _checked variant
and avoid the assert.

mono/metadata/icall.c

index 2d4275ad7f2d02f7a49f63d2dcf3fc2f312f6166..2f9a3b4286d46be037c74e5b1212ec35d1b3b461 100644 (file)
@@ -1703,15 +1703,15 @@ vell_icall_get_method_attributes (MonoMethod *method)
 static void
 ves_icall_get_method_info (MonoMethod *method, MonoMethodInfo *info)
 {
+       MonoError error;
        MonoDomain *domain = mono_domain_get ();
        MonoMethodSignature* sig;
        MONO_ARCH_SAVE_REGS;
 
-       sig = mono_method_signature (method);
-       if (!sig) {
-               g_assert (mono_loader_get_last_error ());
-               mono_raise_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ()));
-       }
+       sig = mono_method_signature_checked (method, &error);
+       if (!mono_error_ok (&error))
+               mono_error_raise_exception (&error);
+
 
        MONO_STRUCT_SETREF (info, parent, mono_type_get_object (domain, &method->klass->byval_arg));
        MONO_STRUCT_SETREF (info, ret, mono_type_get_object (domain, sig->ret));