Skip to content

Commit

Permalink
[mono] Use correct cast_class for IntPtr[]
Browse files Browse the repository at this point in the history
This change fixes the behavior to be like modern .NET instead of .NET Framework.

Fixes dotnet#97145
  • Loading branch information
steveisok committed Jun 21, 2024
1 parent ec996f9 commit 8d3cbd0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/mono/mono/metadata/class-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,18 +1039,14 @@ class_composite_fixup_cast_class (MonoClass *klass, gboolean for_ptr)
case MONO_TYPE_U2:
klass->cast_class = mono_defaults.int16_class;
break;
case MONO_TYPE_U4:
#if TARGET_SIZEOF_VOID_P == 4
case MONO_TYPE_I:
case MONO_TYPE_U:
#endif
klass->cast_class = mono_defaults.int_class;
break;
case MONO_TYPE_U4:
klass->cast_class = mono_defaults.int32_class;
break;
case MONO_TYPE_U8:
#if TARGET_SIZEOF_VOID_P == 8
case MONO_TYPE_I:
case MONO_TYPE_U:
#endif
klass->cast_class = mono_defaults.int64_class;
break;
default:
Expand Down

0 comments on commit 8d3cbd0

Please sign in to comment.