return NULL;
}
v = ((gchar *) o) + sizeof (MonoObject);
- mono_get_constant_value_from_blob (domain, def_type, def_value, v);
+ mono_get_constant_value_from_blob (domain, def_type, def_value, v, &error);
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
break;
}
case MONO_TYPE_STRING:
case MONO_TYPE_CLASS:
- mono_get_constant_value_from_blob (domain, def_type, def_value, &o);
+ mono_get_constant_value_from_blob (domain, def_type, def_value, &o, &error);
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
break;
default:
g_assert_not_reached ();
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) {
break;
}
case MONO_TYPE_U2:
- case MONO_TYPE_I2: {
+ case MONO_TYPE_I2:
+ case MONO_TYPE_CHAR: {
guint16 *p = (guint16 *)mem;
*p = value;
break;
/* 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;
}
ICALL_EXPORT MonoString *
ves_icall_System_IO_DriveInfo_GetDriveFormat (MonoString *path)
{
+ MonoError error;
gunichar2 volume_name [MAX_PATH + 1];
if (GetVolumeInformation (mono_string_chars (path), NULL, 0, NULL, NULL, NULL, volume_name, MAX_PATH + 1) == FALSE)
return NULL;
- return mono_string_from_utf16 (volume_name);
+ MonoString *result = mono_string_from_utf16_checked (volume_name, &error);
+ mono_error_set_pending_exception (&error);
+ return result;
}
ICALL_EXPORT MonoString *
#endif
}
+ICALL_EXPORT
+gint32
+ves_icall_System_Environment_get_TickCount (void)
+{
+ /* this will overflow after ~24 days */
+ return (gint32) (mono_msec_boottime () & 0xffffffff);
+}
+
ICALL_EXPORT gint32
ves_icall_System_Runtime_Versioning_VersioningHelper_GetRuntimeId (void)
{
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 *