Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 035c8587c0d8d307e45f1b7171a0d337bb451f1e 1 parent e34089d
Zoltan Varga authored

Showing 1 changed file with 2 additions and 5 deletions. Show diff stats Hide diff stats

  1. 7  mono/metadata/icall.c
7  mono/metadata/icall.c
@@ -854,12 +854,9 @@ ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray (MonoAr
854 854
 	int align;
855 855
 	const char *field_data;
856 856
 
857  
-	if (MONO_TYPE_IS_REFERENCE (type) ||
858  
-			(type->type == MONO_TYPE_VALUETYPE &&
859  
-				(!mono_type_get_class (type) ||
860  
-				mono_type_get_class (type)->has_references))) {
  857
+	if (MONO_TYPE_IS_REFERENCE (type) || type->type == MONO_TYPE_VALUETYPE) {
861 858
 		MonoException *exc = mono_get_exception_argument("array",
862  
-			"Cannot initialize array containing references");
  859
+			"Cannot initialize array of non-primitive type.");
863 860
 		mono_raise_exception (exc);
864 861
 	}
865 862
 

0 notes on commit 035c858

Please sign in to comment.
Something went wrong with that request. Please try again.