Permalink
Browse files

Allow only primitive types/enums in RuntimeHelpers.InitializeArray ().

  • Loading branch information...
vargaz committed Jan 18, 2011
1 parent e34089d commit 035c8587c0d8d307e45f1b7171a0d337bb451f1e
Showing with 2 additions and 5 deletions.
  1. +2 −5 mono/metadata/icall.c
View
@@ -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);
}

0 comments on commit 035c858

Please sign in to comment.