From 44e0a68b1b0167348a20f6be6844e04b96cd6c65 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Sat, 9 Dec 2023 09:18:50 -0500 Subject: [PATCH] Fix runtime invoke with delegate parameter --- src/mono/mono/mini/mini-amd64.c | 1 + src/mono/mono/mini/mini-arm.c | 1 + src/mono/mono/mini/mini-runtime.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/mini/mini-amd64.c b/src/mono/mono/mini/mini-amd64.c index 6278ae4b9aea7..a45878e16e7d7 100644 --- a/src/mono/mono/mini/mini-amd64.c +++ b/src/mono/mono/mini/mini-amd64.c @@ -2761,6 +2761,7 @@ mono_arch_start_dyn_call (MonoDynCallInfo *info, gpointer **args, guint8 *ret, g switch (t->type) { case MONO_TYPE_OBJECT: case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: case MONO_TYPE_I: case MONO_TYPE_U: #if !defined(MONO_ARCH_ILP32) diff --git a/src/mono/mono/mini/mini-arm.c b/src/mono/mono/mini/mini-arm.c index 29546e1c23199..a6e6328e814af 100644 --- a/src/mono/mono/mini/mini-arm.c +++ b/src/mono/mono/mini/mini-arm.c @@ -3001,6 +3001,7 @@ mono_arch_start_dyn_call (MonoDynCallInfo *info, gpointer **args, guint8 *ret, g switch (t->type) { case MONO_TYPE_OBJECT: case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: case MONO_TYPE_I: case MONO_TYPE_U: p->regs [slot] = (host_mgreg_t)(gsize)*arg; diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index 53cab36cfb255..7fce0add222d3 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -3622,7 +3622,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec if (m_type_is_byref (t)) { args [pindex ++] = ¶ms [i]; - } else if (MONO_TYPE_IS_REFERENCE (t) || t->type == MONO_TYPE_PTR) { + } else if (MONO_TYPE_IS_REFERENCE (t) || t->type == MONO_TYPE_PTR || t->type == MONO_TYPE_FNPTR) { args [pindex ++] = ¶ms [i]; } else { args [pindex ++] = params [i];