Slightly change UC_CTL_TB_REMOVE_CACHE

This commit is contained in:
lazymio
2021-11-08 22:09:33 +01:00
parent 6ec016327d
commit 35017a614f
4 changed files with 13 additions and 6 deletions

7
uc.c
View File

@ -2105,7 +2105,12 @@ uc_err uc_ctl(uc_engine *uc, uc_control_type control, ...)
if (rw == UC_CTL_IO_WRITE) {
uint64_t addr = va_arg(args, uint64_t);
uc->uc_invalidate_tb(uc, addr, 1);
uint64_t end = va_arg(args, uint64_t);
if (end <= addr) {
err = UC_ERR_ARG;
} else {
uc->uc_invalidate_tb(uc, addr, end - addr);
}
} else {
err = UC_ERR_ARG;
}