Add a regression test for invalidating empty TB and have a better solution

This commit is contained in:
lazymio
2021-11-03 01:07:06 +01:00
parent c11b9aa5c3
commit eb75d459f0
3 changed files with 36 additions and 7 deletions

View File

@ -1745,7 +1745,8 @@ tb_invalidate_phys_page_range__locked(struct uc_struct *uc, struct page_collecti
tb_start = tb->page_addr[1];
tb_end = tb_start + ((tb->pc + tb->size) & ~TARGET_PAGE_MASK);
}
if (!(tb_end <= start || tb_start >= end)) {
// Unicorn: We may indeed generate a TB without any instruction which breaks qemu assumption.
if ( (!(tb_end <= start || tb_start >= end)) || (tb_start == tb_end) ) {
#ifdef TARGET_HAS_PRECISE_SMC
if (current_tb_not_found) {
current_tb_not_found = false;