Cache index for find_memory_region

This commit is contained in:
Choongwoo Han 2023-03-20 17:07:15 -07:00 committed by Choongwoo Han
parent a0ff413830
commit 8f2841ecdb
1 changed files with 3 additions and 1 deletions

4
uc.c
View File

@ -1532,8 +1532,10 @@ MemoryRegion *find_memory_region(struct uc_struct *uc, uint64_t address)
if (i < uc->mapped_block_count && if (i < uc->mapped_block_count &&
address >= uc->mapped_blocks[i]->addr && address >= uc->mapped_blocks[i]->addr &&
address <= uc->mapped_blocks[i]->end - 1) address < uc->mapped_blocks[i]->end) {
uc->mapped_block_cache_index = i;
return uc->mapped_blocks[i]; return uc->mapped_blocks[i];
}
// not found // not found
return NULL; return NULL;