Skip to content

Commit

Permalink
[llvm] Fix the computation of size of gshared instances in another pl…
Browse files Browse the repository at this point in the history
…ace.

Fixes mono#13610.
  • Loading branch information
vargaz authored and monojenkins committed Mar 28, 2019
1 parent bff188a commit 5ab9ae1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mono/mini/mini-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2417,6 +2417,7 @@ emit_vtype_to_args (EmitContext *ctx, LLVMBuilderRef builder, MonoType *t, LLVMV
int j, size, nslots;
LLVMTypeRef arg_type;

t = mini_get_underlying_type (t);
size = get_vtype_size (t);

if (MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type_internal (t)))
Expand Down Expand Up @@ -3248,11 +3249,12 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
case LLVMArgAsIArgs: {
LLVMValueRef arg = LLVMGetParam (ctx->lmethod, pindex);
int size;
MonoType *t = mini_get_underlying_type (ainfo->type);

/* The argument is received as an array of ints, store it into the real argument */
ctx->addresses [reg] = build_alloca (ctx, ainfo->type);
ctx->addresses [reg] = build_alloca (ctx, t);

size = mono_class_value_size (mono_class_from_mono_type_internal (ainfo->type), NULL);
size = mono_class_value_size (mono_class_from_mono_type_internal (t), NULL);
if (size == 0) {
} else if (size < TARGET_SIZEOF_VOID_P) {
/* The upper bits of the registers might not be valid */
Expand Down

0 comments on commit 5ab9ae1

Please sign in to comment.