+2010-06-29 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * icall.c (ves_icall_Type_make_array_type): Raise a TLE if a
+ TypedByRef is passed.
+
+ * icall.c (ves_icall_Type_make_byref_type): Ditto.
+
+ * icall.c (ves_icall_Type_MakePointerType): Ditto.
+
+ Fixes #612780.
+
2010-06-29 Rodrigo Kumpera <rkumpera@novell.com>
* assembly.c: Add a few more assemblies to the list of framework
return res;
}
+static void
+check_for_invalid_type (MonoClass *klass)
+{
+ char *name;
+ MonoString *str;
+ if (klass->byval_arg.type != MONO_TYPE_TYPEDBYREF)
+ return;
+
+ name = mono_type_get_full_name (klass);
+ str = mono_string_new (mono_domain_get (), name);
+ g_free (name);
+ mono_raise_exception ((MonoException*)mono_get_exception_type_load (str, NULL));
+
+}
static MonoReflectionType *
ves_icall_Type_make_array_type (MonoReflectionType *type, int rank)
{
klass = mono_class_from_mono_type (type->type);
mono_class_init_or_throw (klass);
+ check_for_invalid_type (klass);
if (rank == 0) //single dimentional array
aklass = mono_array_class_get (klass, 1);
klass = mono_class_from_mono_type (type->type);
mono_class_init_or_throw (klass);
+ check_for_invalid_type (klass);
return mono_type_get_object (mono_object_domain (type), &klass->this_arg);
}
static MonoReflectionType *
ves_icall_Type_MakePointerType (MonoReflectionType *type)
{
- MonoClass *pklass;
+ MonoClass *klass, *pklass;
- mono_class_init_or_throw (mono_class_from_mono_type (type->type));
+ klass = mono_class_from_mono_type (type->type);
+ mono_class_init_or_throw (klass);
+ check_for_invalid_type (klass);
pklass = mono_ptr_class_get (type->type);