mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-07 14:40:53 +00:00
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:
parent
07e8f2f60d
commit
5719481e3f
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;
|
MemoryRegion **regions;
|
||||||
|
|
||||||
// this area overlaps existing mapped regions?
|
|
||||||
if (memory_overlap(uc, address, size))
|
|
||||||
return UC_ERR_MAP;
|
|
||||||
|
|
||||||
if (block == NULL)
|
if (block == NULL)
|
||||||
return UC_ERR_NOMEM;
|
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)
|
if ((perms & ~UC_PROT_ALL) != 0)
|
||||||
return UC_ERR_ARG;
|
return UC_ERR_ARG;
|
||||||
|
|
||||||
|
// this area overlaps existing mapped regions?
|
||||||
|
if (memory_overlap(uc, address, size)) {
|
||||||
|
return UC_ERR_MAP;
|
||||||
|
}
|
||||||
|
|
||||||
return UC_ERR_OK;
|
return UC_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue