mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 02:05:36 +00:00
target/i386: fix translation for icount mode
This patch fixes the checking of boundary crossing instructions. In icount mode only first instruction of the block may cross the page boundary to keep the translation deterministic. These conditions already existed, but compared the wrong variable. Backports commit 41d54dc09f1f327dedc79d5ba0b1b437ab7b0e94 from qemu
This commit is contained in:
parent
710467e034
commit
461fbaa9eb
|
@ -9173,10 +9173,10 @@ static void i386_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
|
|||
chance to happen */
|
||||
dc->base.is_jmp = DISAS_TOO_MANY;
|
||||
} else if ((dc->base.tb->cflags & CF_USE_ICOUNT)
|
||||
&& ((dc->base.pc_next & TARGET_PAGE_MASK)
|
||||
!= ((dc->base.pc_next + TARGET_MAX_INSN_SIZE - 1)
|
||||
&& ((pc_next & TARGET_PAGE_MASK)
|
||||
!= ((pc_next + TARGET_MAX_INSN_SIZE - 1)
|
||||
& TARGET_PAGE_MASK)
|
||||
|| (dc->base.pc_next & ~TARGET_PAGE_MASK) == 0)) {
|
||||
|| (pc_next & ~TARGET_PAGE_MASK) == 0)) {
|
||||
/* Do not cross the boundary of the pages in icount mode,
|
||||
it can cause an exception. Do it only when boundary is
|
||||
crossed by the first instruction in the block.
|
||||
|
|
Loading…
Reference in a new issue