Skip to content
Permalink
Browse files Browse the repository at this point in the history
Allow only primitive types/enums in RuntimeHelpers.InitializeArray ().
  • Loading branch information
vargaz committed Jan 18, 2011
1 parent e34089d commit 035c858
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mono/metadata/icall.c
Expand Up @@ -854,12 +854,9 @@ ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray (MonoAr
int align;
const char *field_data;

if (MONO_TYPE_IS_REFERENCE (type) ||
(type->type == MONO_TYPE_VALUETYPE &&
(!mono_type_get_class (type) ||
mono_type_get_class (type)->has_references))) {
if (MONO_TYPE_IS_REFERENCE (type) || type->type == MONO_TYPE_VALUETYPE) {
MonoException *exc = mono_get_exception_argument("array",
"Cannot initialize array containing references");
"Cannot initialize array of non-primitive type.");
mono_raise_exception (exc);
}

Expand Down

0 comments on commit 035c858

Please sign in to comment.