From 93701457acdb709b467a3e0ba04e0c3507ddb050 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Fri, 23 Feb 2018 23:15:11 -0500 Subject: [PATCH] [llvm] Pass only the imt argument if both imt and rgctx arguments are required. https://github.com/mono/mono/issues/7240 --- mono/mini/mini-llvm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mono/mini/mini-llvm.c b/mono/mini/mini-llvm.c index e8e57d0d8276a..c5d261803d186 100644 --- a/mono/mini/mini-llvm.c +++ b/mono/mini/mini-llvm.c @@ -3180,6 +3180,10 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, gboolean is_virtual, calli, preserveall; LLVMBuilderRef builder = *builder_ref; + /* If both imt and rgctx arg are required, only pass the imt arg, the rgctx trampoline will pass the rgctx */ + if (call->imt_arg_reg) + call->rgctx_arg_reg = 0; + if ((call->signature->call_convention != MONO_CALL_DEFAULT) && !((call->signature->call_convention == MONO_CALL_C) && ctx->llvm_only)) { set_failure (ctx, "non-default callconv"); return;