From 8db3cab69e3afe8c25d295edb8b1d599518e4eca Mon Sep 17 00:00:00 2001 From: Matous Kozak <55735845+matouskozak@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:57:44 +0200 Subject: [PATCH] [mono] Add missing return in mono_type_to_load_membase (#106798) 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. --- src/mono/mono/mini/mini.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/mono/mini/mini.c b/src/mono/mono/mini/mini.c index 395a869ab22bec..63d89b3f28a561 100644 --- a/src/mono/mono/mini/mini.c +++ b/src/mono/mono/mini/mini.c @@ -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: