move memory_overlap() around from mem_map() to mem_map_check(). this fixes test_mem_map.c in issue #420
This commit is contained in:
9
uc.c
9
uc.c
@ -622,10 +622,6 @@ static uc_err mem_map(uc_engine *uc, uint64_t address, size_t size, uint32_t per
|
||||
{
|
||||
MemoryRegion **regions;
|
||||
|
||||
// this area overlaps existing mapped regions?
|
||||
if (memory_overlap(uc, address, size))
|
||||
return UC_ERR_MAP;
|
||||
|
||||
if (block == NULL)
|
||||
return UC_ERR_NOMEM;
|
||||
|
||||
@ -666,6 +662,11 @@ static uc_err mem_map_check(uc_engine *uc, uint64_t address, size_t size, uint32
|
||||
if ((perms & ~UC_PROT_ALL) != 0)
|
||||
return UC_ERR_ARG;
|
||||
|
||||
// this area overlaps existing mapped regions?
|
||||
if (memory_overlap(uc, address, size)) {
|
||||
return UC_ERR_MAP;
|
||||
}
|
||||
|
||||
return UC_ERR_OK;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user