Skip to content

Commit

Permalink
Fix mono arm assert with large return structs (mono#21577)
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmes authored and ThomasKuehne committed Mar 23, 2024
1 parent 778b0fe commit 22d6da2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mono/mini/mini-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -6322,8 +6322,12 @@ mono_arch_emit_prolog (MonoCompile *cfg)
if (cinfo->ret.storage == RegTypeStructByAddr) {
ArgInfo *ainfo = &cinfo->ret;
inst = cfg->vret_addr;
g_assert (arm_is_imm12 (inst->inst_offset));
ARM_STR_IMM (code, ainfo->reg, inst->inst_basereg, inst->inst_offset);
if (arm_is_imm12 (inst->inst_offset)) {
ARM_STR_IMM (code, ainfo->reg, inst->inst_basereg, inst->inst_offset);
} else {
code = mono_arm_emit_load_imm (code, ARMREG_LR, inst->inst_offset);
ARM_STR_REG_REG (code, ainfo->reg, inst->inst_basereg, ARMREG_LR);
}
}

if (sig->call_convention == MONO_CALL_VARARG) {
Expand Down

0 comments on commit 22d6da2

Please sign in to comment.