#include "mono/utils/mono-counters.h"
#include "mono/utils/strenc.h"
#include "mono/utils/atomic.h"
+#include "mono/utils/mono-error.h"
+#include "mono/utils/mono-error-internals.h"
#include <string.h>
#include <errno.h>
static MonoReflectionType *
cominterop_type_from_handle (MonoType *handle)
{
+ MonoError error;
+ MonoReflectionType *ret;
MonoDomain *domain = mono_domain_get ();
MonoClass *klass = mono_class_from_mono_type (handle);
mono_class_init (klass);
- return mono_type_get_object (domain, handle);
+
+ ret = mono_type_get_object_checked (domain, handle, &error);
+ mono_error_raise_exception (&error); /* FIXME don't raise here */
+
+ return ret;
}
void
MonoObject *
ves_icall_System_ComObject_CreateRCW (MonoReflectionType *type)
{
+ MonoError error;
MonoClass *klass;
MonoDomain *domain;
MonoObject *obj;
domain = mono_object_domain (type);
klass = mono_class_from_mono_type (type->type);
- /* call mono_object_new_alloc_specific instead of mono_object_new
+ /* call mono_object_new_alloc_specific_checked instead of mono_object_new
* because we want to actually create object. mono_object_new checks
* to see if type is import and creates transparent proxy. this method
* is called by the corresponding real proxy to create the real RCW.
* Constructor does not need to be called. Will be called later.
*/
- obj = mono_object_new_alloc_specific (mono_class_vtable_full (domain, klass, TRUE));
+ obj = mono_object_new_alloc_specific_checked (mono_class_vtable_full (domain, klass, TRUE), &error);
+ mono_error_raise_exception (&error);
+
return obj;
}
static gboolean
mono_marshal_safearray_begin (gpointer safearray, MonoArray **result, gpointer *indices, gpointer empty, gpointer parameter, gboolean allocateNewArray)
{
+ MonoError error;
int dim;
uintptr_t *sizes;
intptr_t *bounds;
if (allocateNewArray) {
aklass = mono_bounded_array_class_get (mono_defaults.object_class, dim, bounded);
- *result = mono_array_new_full (mono_domain_get (), aklass, sizes, bounds);
+ *result = mono_array_new_full_checked (mono_domain_get (), aklass, sizes, bounds, &error);
+ mono_error_raise_exception (&error); /* FIXME don't raise here */
} else {
*result = (MonoArray *)parameter;
}