[mono][interp] Add support for missing argument storage type (#88606)
authorVlad Brezae <brezaevlad@gmail.com>
Mon, 10 Jul 2023 18:45:51 +0000 (21:45 +0300)
committerGitHub <noreply@github.com>
Mon, 10 Jul 2023 18:45:51 +0000 (13:45 -0500)
When a valuetype is passed by ref on the stack

src/mono/mono/mini/mini-arm64.c

index 2fbe4c0..c6f8cff 100644 (file)
@@ -1794,6 +1794,8 @@ arg_get_storage (CallContext *ccontext, ArgInfo *ainfo)
                case ArgOnStackR8:
                case ArgVtypeOnStack:
                        return ccontext->stack + ainfo->offset;
+               case ArgVtypeByRefOnStack:
+                       return *(gpointer*)(ccontext->stack + ainfo->offset);
                case ArgVtypeByRef:
                        return (gpointer) ccontext->gregs [ainfo->reg];
                 default:
@@ -1856,6 +1858,10 @@ mono_arch_set_native_call_context_args (CallContext *ccontext, gpointer frame, M
                if (ainfo->storage == ArgVtypeByRef) {
                        ccontext->gregs [ainfo->reg] = (host_mgreg_t)interp_cb->frame_arg_to_storage ((MonoInterpFrameHandle)frame, sig, i);
                        continue;
+               } else if (ainfo->storage == ArgVtypeByRefOnStack) {
+                       storage = ccontext->stack + ainfo->offset;
+                       *(gpointer*)storage = interp_cb->frame_arg_to_storage (frame, sig, i);
+                       continue;
                }
 
                int temp_size = arg_need_temp (ainfo);