Fix wrong offset used in split_region

This commit is contained in:
lazymio
2021-11-23 23:22:53 +01:00
parent c1c5f72918
commit c733bbada3
2 changed files with 5 additions and 2 deletions

3
uc.c
View File

@ -1090,7 +1090,8 @@ static bool split_region(struct uc_struct *uc, MemoryRegion *mr,
QLIST_FOREACH(block, &uc->ram_list.blocks, next)
{
if (block->offset <= mr->addr &&
// block->offset is the offset within ram_addr_t, not GPA
if (block->mr->addr <= mr->addr &&
block->used_length >= (mr->end - mr->addr)) {
break;
}