goto leave;
g_assert (base);
gint32 rank = MONO_HANDLE_GETVAL (sre_array, rank);
- if (rank == 0) //single dimentional array
- result = &mono_array_class_get (mono_class_from_mono_type (base), 1)->byval_arg;
- else
- result = &mono_bounded_array_class_get (mono_class_from_mono_type (base), rank, TRUE)->byval_arg;
+ MonoClass *eclass = mono_class_from_mono_type (base);
+ result = mono_image_new0 (eclass->image, MonoType, 1);
+ if (rank == 0) {
+ result->type = MONO_TYPE_SZARRAY;
+ result->data.klass = eclass;
+ } else {
+ MonoArrayType *at = (MonoArrayType *)mono_image_alloc0 (eclass->image, sizeof (MonoArrayType));
+ result->type = MONO_TYPE_ARRAY;
+ result->data.array = at;
+ at->eklass = eclass;
+ at->rank = rank;
+ }
MONO_HANDLE_SETVAL (ref, type, MonoType*, result);
} else if (is_sre_byref (klass)) {
MonoReflectionDerivedTypeHandle sre_byref = MONO_HANDLE_CAST (MonoReflectionDerivedType, ref);