Przeglądaj źródła

2010-01-25 Zoltan Varga <[email protected]>

	* icall.c (ves_icall_System_Array_SetValueImpl): Handle nullable types correctly.
	Fixes #573322.

svn path=/trunk/mono/; revision=150123
Zoltan Varga 16 lat temu
rodzic
commit
4ad6137fb9
2 zmienionych plików z 10 dodań i 0 usunięć
  1. 5 0
      mono/metadata/ChangeLog
  2. 5 0
      mono/metadata/icall.c

+ 5 - 0
mono/metadata/ChangeLog

@@ -1,3 +1,8 @@
+2010-01-25  Zoltan Varga  <[email protected]>
+
+	* icall.c (ves_icall_System_Array_SetValueImpl): Handle nullable types correctly.
+	Fixes #573322.
+
 2010-01-23  Mark Probst  <[email protected]>
 
 	* sgen-pinning.c (evacuate_pin_staging_area): Don't assume

+ 5 - 0
mono/metadata/icall.c

@@ -259,6 +259,11 @@ ves_icall_System_Array_SetValueImpl (MonoArray *this, MonoObject *value, guint32
 	ea = (gpointer*)((char*)this->vector + (pos * esize));
 	va = (gpointer*)((char*)value + sizeof (MonoObject));
 
+	if (mono_class_is_nullable (ec)) {
+		mono_nullable_init ((guint8*)ea, value, ec);
+		return;
+	}
+
 	if (!value) {
 		memset (ea, 0,  esize);
 		return;