mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-24 17:55:39 +00:00
target-sparc: fix register corruption in ldstub if there is no write permission
Backports commit 9566ceeef41ccb5241d340b34776a33450e8f9e5 from qemu
This commit is contained in:
parent
44c4dd02c9
commit
1781d5cfa6
|
@ -4805,12 +4805,15 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins
|
||||||
case 0xd: /* ldstub -- XXX: should be atomically */
|
case 0xd: /* ldstub -- XXX: should be atomically */
|
||||||
{
|
{
|
||||||
TCGv r_const;
|
TCGv r_const;
|
||||||
|
TCGv tmp = tcg_temp_new(tcg_ctx);
|
||||||
|
|
||||||
gen_address_mask(dc, cpu_addr);
|
gen_address_mask(dc, cpu_addr);
|
||||||
tcg_gen_qemu_ld8u(dc->uc, cpu_val, cpu_addr, dc->mem_idx);
|
tcg_gen_qemu_ld8u(dc->uc, tmp, cpu_addr, dc->mem_idx);
|
||||||
r_const = tcg_const_tl(tcg_ctx, 0xff);
|
r_const = tcg_const_tl(tcg_ctx, 0xff);
|
||||||
tcg_gen_qemu_st8(dc->uc, r_const, cpu_addr, dc->mem_idx);
|
tcg_gen_qemu_st8(dc->uc, r_const, cpu_addr, dc->mem_idx);
|
||||||
|
tcg_gen_mov_tl(tcg_ctx, cpu_val, tmp);
|
||||||
tcg_temp_free(tcg_ctx, r_const);
|
tcg_temp_free(tcg_ctx, r_const);
|
||||||
|
tcg_temp_free(tcg_ctx, tmp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x0f:
|
case 0x0f:
|
||||||
|
|
Loading…
Reference in a new issue