From: Rodrigo Kumpera Date: Fri, 29 Oct 2010 15:26:28 +0000 (-0200) Subject: Replace an assert with a nicer check. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=ab6ed140dc1d96c12e1da6e3cc8e594c01d121f8;p=mono.git Replace an assert with a nicer check. * icall.c (ves_icall_get_method_info): Use _checked variant and avoid the assert. --- diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c index 2d4275ad7f2..2f9a3b4286d 100644 --- a/mono/metadata/icall.c +++ b/mono/metadata/icall.c @@ -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));