Fix the wrong block found when doing split_region
This commit is contained in:
4
uc.c
4
uc.c
@ -1198,11 +1198,13 @@ static bool split_region(struct uc_struct *uc, MemoryRegion *mr,
|
||||
return false;
|
||||
}
|
||||
|
||||
// Find the correct and large enough (which contains our target mr)
|
||||
// to create the content backup.
|
||||
QLIST_FOREACH(block, &uc->ram_list.blocks, next)
|
||||
{
|
||||
// block->offset is the offset within ram_addr_t, not GPA
|
||||
if (block->mr->addr <= mr->addr &&
|
||||
block->used_length >= (mr->end - mr->addr)) {
|
||||
block->used_length + block->mr->addr >= mr->end) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user