if (method_is_dynamic (method)) {
/* Creating a trampoline would leak memory */
- func = mono_compile_method (method);
+ func = mono_compile_method_checked (method, &error);
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
} else {
if (target && method->flags & METHOD_ATTRIBUTE_VIRTUAL && method->klass != mono_object_class (target))
method = mono_object_get_virtual_method (target, method);
ICALL_EXPORT gpointer
ves_icall_RuntimeMethodHandle_GetFunctionPointer (MonoMethod *method)
{
- return mono_compile_method (method);
+ MonoError error;
+ gpointer result = mono_compile_method_checked (method, &error);
+ mono_error_set_pending_exception (&error);
+ return result;
}
ICALL_EXPORT MonoString *