return (MonoObject*)arr;
}
}
- return mono_runtime_invoke_array (m, obj, params, NULL);
+ MonoObject *result = mono_runtime_invoke_array_checked (m, obj, params, &error);
+ mono_error_set_pending_exception (&error);
+ return result;
}
#ifndef DISABLE_REMOTING
/* This can be called only on MBR objects, so no need to unbox for valuetypes. */
g_assert (!method->method->klass->valuetype);
- result = mono_runtime_invoke_array (method->method, this_arg, params, NULL);
+ result = mono_runtime_invoke_array_checked (method->method, this_arg, params, &error);
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
for (i = 0, j = 0; i < mono_array_length (params); i++) {
if (sig->params [i]->byref) {
/* FIXME: What to do if the index points into the middle of a string ? */
- return mono_ldstr (mono_domain_get (), image, index);
+ MonoString *result = mono_ldstr_checked (mono_domain_get (), image, index, &error);
+ mono_error_set_pending_exception (&error);
+ return result;
}
ICALL_EXPORT MonoClassField*
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);
func = mono_create_ftnptr (mono_domain_get (), trampoline);
}
- mono_delegate_ctor_with_method (delegate, target, func, method);
-
+ mono_delegate_ctor_with_method (delegate, target, func, method, &error);
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
return delegate;
}
MonoReflectionMethod *method,
MonoArray *out_args)
{
- mono_message_init (mono_object_domain (this_obj), this_obj, method, out_args);
+ MonoError error;
+ mono_message_init (mono_object_domain (this_obj), this_obj, method, out_args, &error);
+ mono_error_set_pending_exception (&error);
}
#ifndef DISABLE_REMOTING
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 *