Fix UC_HOOK_EDGE_GENERATED implementation

This commit is contained in:
lazymio
2021-11-11 22:15:15 +01:00
parent fafec703e1
commit 7e244f87b4

View File

@ -257,18 +257,6 @@ static inline TranslationBlock *tb_find(CPUState *cpu,
mmap_unlock();
/* We add the TB in the virtual pc hash table for the fast lookup */
cpu->tb_jmp_cache[tb_jmp_cache_hash_func(cpu->uc, pc)] = tb;
}
/* We don't take care of direct jumps when address mapping changes in
* system emulation. So it's not safe to make a direct jump to a TB
* spanning two pages because the mapping for the second page can change.
*/
if (tb->page_addr[1] != -1) {
last_tb = NULL;
}
/* See if we can patch the calling TB. */
if (last_tb) {
tb_add_jump(last_tb, tb_exit, tb);
}
UC_TB_COPY(&cur_tb, tb);
@ -285,6 +273,18 @@ static inline TranslationBlock *tb_find(CPUState *cpu,
}
}
}
}
/* We don't take care of direct jumps when address mapping changes in
* system emulation. So it's not safe to make a direct jump to a TB
* spanning two pages because the mapping for the second page can change.
*/
if (tb->page_addr[1] != -1) {
last_tb = NULL;
}
/* See if we can patch the calling TB. */
if (last_tb) {
tb_add_jump(last_tb, tb_exit, tb);
}
return tb;
}