From 8fc05ec582ba88feb86f4833872fcd59c91895fe Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Mon, 2 Nov 2020 19:47:33 -0500 Subject: [PATCH] Fix an assert which is hit when compiling Microsoft.CodeAnalysis.dll with llvmonly. (#44092) --- src/mono/mono/mini/mini-llvm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 568e786..73d77af 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -3645,7 +3645,8 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) } case LLVMArgGsharedvtVariable: /* The IR treats these as variables with addresses */ - ctx->addresses [reg] = LLVMGetParam (ctx->lmethod, pindex); + if (!ctx->addresses [reg]) + ctx->addresses [reg] = LLVMGetParam (ctx->lmethod, pindex); break; default: { LLVMTypeRef t; @@ -9435,7 +9436,6 @@ emit_method_inner (EmitContext *ctx) LLVMValueRef method = NULL; LLVMValueRef *values = ctx->values; int i, max_block_num, bb_index; - gboolean last = FALSE; gboolean llvmonly_fail = FALSE; LLVMCallInfo *linfo; LLVMModuleRef lmodule = ctx->lmodule; @@ -9464,7 +9464,6 @@ emit_method_inner (EmitContext *ctx) if (count == lcount) { printf ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE)); fflush (stdout); - last = TRUE; } if (count > lcount) { set_failure (ctx, "count"); -- 2.7.4