Skip to content

Commit

Permalink
2010-04-07 Rodrigo Kumpera <rkumpera@novell.com>
Browse files Browse the repository at this point in the history
	class.c (mono_bounded_array_class_get): Properly init
	cast_class to take the fact that uint[] and int[] can be
	casted between each other.

	Fixes #555950.

svn path=/trunk/mono/; revision=155012
  • Loading branch information
kumpera committed Apr 7, 2010
1 parent f555b84 commit 2864540
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mono/metadata/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2010-04-07 Rodrigo Kumpera <rkumpera@novell.com>

class.c (mono_bounded_array_class_get): Properly init
cast_class to take the fact that uint[] and int[] can be
casted between each other.

Fixes #555950.

2010-04-08 Zoltan Varga <vargaz@gmail.com>

* icall.c (ves_icall_System_Enum_ToObject): Avoid a crash for unfinished type
Expand Down
23 changes: 23 additions & 0 deletions mono/metadata/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -5779,6 +5779,29 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
else
class->cast_class = eclass;

switch (class->cast_class->byval_arg.type) {
case MONO_TYPE_I1:
class->cast_class = mono_defaults.byte_class;
break;
case MONO_TYPE_U2:
class->cast_class = mono_defaults.int16_class;
break;
case MONO_TYPE_U4:
#if SIZEOF_VOID_P == 4
case MONO_TYPE_I:
case MONO_TYPE_U:
#endif
class->cast_class = mono_defaults.int32_class;
break;
case MONO_TYPE_U8:
#if SIZEOF_VOID_P == 8
case MONO_TYPE_I:
case MONO_TYPE_U:
#endif
class->cast_class = mono_defaults.int64_class;
break;
}

class->element_class = eclass;

if ((rank > 1) || bounded) {
Expand Down

0 comments on commit 2864540

Please sign in to comment.