Skip to content

Commit 10d342c

Browse files
[ppc64le] Fixed FSharp crash issue (#77201)
* [ppc64le] Fixed thunk address 8 byte alignment issue * Fixed FSharp crash issue
1 parent acb4564 commit 10d342c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/mono/mono/mini/mini-ppc.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,23 +3782,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
37823782
ppc_addis (code, ppc_r12, cfg->frame_reg, ppc_ha(cfg->stack_usage));
37833783
ppc_addi (code, ppc_r12, ppc_r12, cfg->stack_usage);
37843784
}
3785-
if (!cfg->method->save_lmf) {
3786-
pos = 0;
3787-
for (i = 31; i >= 13; --i) {
3788-
if (cfg->used_int_regs & (1 << i)) {
3789-
pos += sizeof (target_mgreg_t);
3790-
ppc_ldptr (code, i, -pos, ppc_r12);
3791-
}
3792-
}
3793-
} else {
3794-
/* FIXME restore from MonoLMF: though this can't happen yet */
3795-
}
37963785

37973786
/* Copy arguments on the stack to our argument area */
37983787
if (call->stack_usage) {
37993788
code = emit_memcpy (code, call->stack_usage, ppc_r12, PPC_STACK_PARAM_OFFSET, ppc_sp, PPC_STACK_PARAM_OFFSET);
38003789
/* r12 was clobbered */
3801-
g_assert (cfg->frame_reg == ppc_sp);
38023790
if (ppc_is_imm16 (cfg->stack_usage)) {
38033791
ppc_addi (code, ppc_r12, cfg->frame_reg, cfg->stack_usage);
38043792
} else {
@@ -3809,6 +3797,18 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
38093797
}
38103798
}
38113799

3800+
if (!cfg->method->save_lmf) {
3801+
pos = 0;
3802+
for (i = 31; i >= 13; --i) {
3803+
if (cfg->used_int_regs & (1 << i)) {
3804+
pos += sizeof (target_mgreg_t);
3805+
ppc_ldptr (code, i, -pos, ppc_r12);
3806+
}
3807+
}
3808+
} else {
3809+
/* FIXME restore from MonoLMF: though this can't happen yet */
3810+
}
3811+
38123812
ppc_mr (code, ppc_sp, ppc_r12);
38133813
mono_add_patch_info (cfg, (guint8*) code - cfg->native_code, MONO_PATCH_INFO_METHOD_JUMP, call->method);
38143814
cfg->thunk_area += THUNK_SIZE;

0 commit comments

Comments
 (0)