From c90ec48f596c5d18c07724c749fa13c5ad07161d Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Tue, 13 Apr 2021 20:13:30 +0300 Subject: [PATCH 16/32] [arm64] Fix wrong marshalling in gsharedvt transition (#21006) Transitioning from ArgVtypeByRefOnStack to ArgVtypeByRef requires no marshalling. The reference ends up being saved on stack the same way and the stack slot just needs to be copied (in mono_arm_start_gsharedvt_call). --- mono/mini/mini-arm64-gsharedvt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mono/mini/mini-arm64-gsharedvt.c b/mono/mini/mini-arm64-gsharedvt.c index 67689024464..f3a0653a03a 100644 --- a/mono/mini/mini-arm64-gsharedvt.c +++ b/mono/mini/mini-arm64-gsharedvt.c @@ -229,7 +229,7 @@ mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_si } if (ainfo2->storage == ArgVtypeByRef && ainfo2->gsharedvt) { /* Pass the address of the first src slot in a reg */ - if (ainfo->storage != ArgVtypeByRef) { + if (ainfo->storage != ArgVtypeByRef && ainfo->storage != ArgVtypeByRefOnStack) { if (ainfo->storage == ArgHFA && ainfo->esize == 4) { arg_marshal = GSHAREDVT_ARG_BYVAL_TO_BYREF_HFAR4; g_assert (src [0] < 64); @@ -244,7 +244,7 @@ mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_si dst [0] = map_reg (ainfo2->reg); } else if (ainfo2->storage == ArgVtypeByRefOnStack && ainfo2->gsharedvt) { /* Pass the address of the first src slot in a stack slot */ - if (ainfo->storage != ArgVtypeByRef) + if (ainfo->storage != ArgVtypeByRef && ainfo->storage != ArgVtypeByRefOnStack) arg_marshal = GSHAREDVT_ARG_BYVAL_TO_BYREF; ndst = 1; dst = g_new0 (int, 1); -- 2.31.1