Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 035c8587c0d8d307e45f1b7171a0d337bb451f1e 1 parent e34089d
Zoltan Varga vargaz authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 mono/metadata/icall.c
7 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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.