Skip to content

Commit

Permalink
[mono] Add missing return in mono_type_to_load_membase (#106798)
Browse files Browse the repository at this point in the history
There was a missing return for MONO_TYPE_VALUETYPE in mono_type_to_load_membase. It works correctly even without this fix but only by coincidence because the following case is MONO_TYPE_TYPEDBYREF which returns the same OP_LOADV_MEMBASE op code.
  • Loading branch information
matouskozak authored and pull[bot] committed Aug 28, 2024
1 parent 76e4552 commit 2023102
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mono/mono/mini/mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ mono_type_to_load_membase (MonoCompile *cfg, MonoType *type)
case MONO_TYPE_VALUETYPE:
if (mini_class_is_simd (cfg, mono_class_from_mono_type_internal (type)))
return OP_LOADX_MEMBASE;
return OP_LOADV_MEMBASE;
case MONO_TYPE_TYPEDBYREF:
return OP_LOADV_MEMBASE;
case MONO_TYPE_GENERICINST:
Expand Down

0 comments on commit 2023102

Please sign in to comment.