return NULL in memory_mapping() if no memory is mapped. this fixes test_bad_unmap in test_x86.c

This commit is contained in:
Nguyen Anh Quynh 2015-09-21 22:17:26 +08:00
parent 441d15e314
commit 26ee533303
1 changed files with 3 additions and 0 deletions

3
uc.c
View File

@ -809,6 +809,9 @@ MemoryRegion *memory_mapping(struct uc_struct* uc, uint64_t address)
{
unsigned int i;
if (uc->mapped_block_count == 0)
return NULL;
// try with the cache index first
i = uc->mapped_block_cache_index;