Fix exits wrongly cleared in nested uc_emu_start

This commit is contained in:
2022-03-06 23:40:34 +01:00
parent 12fa73f2b6
commit 09b15e9071
3 changed files with 20 additions and 13 deletions

View File

@@ -214,8 +214,11 @@ void resume_all_vcpus(struct uc_struct* uc)
// clear the cache of the exits address, since the generated code
// at that address is to exit emulation, but not for the instruction there.
// if we dont do this, next time we cannot emulate at that address
g_tree_foreach(uc->exits, uc_exit_invalidate_iter, (void*)uc);
if (uc->use_exits) {
g_tree_foreach(uc->ctl_exits, uc_exit_invalidate_iter, (void*)uc);
} else {
uc_exit_invalidate_iter((gpointer)&uc->exits[uc->nested_level - 1], NULL, (gpointer)uc);
}
cpu->created = false;
}