do not abort() when memory is insufficient. this fixes issue #244

This commit is contained in:
Nguyen Anh Quynh
2015-11-10 11:44:29 +08:00
parent 87ce40eb00
commit 272293556a
5 changed files with 14 additions and 3 deletions

View File

@@ -36,6 +36,9 @@ MemoryRegion *memory_map(struct uc_struct *uc, ram_addr_t begin, size_t size, ui
MemoryRegion *ram = g_new(MemoryRegion, 1);
memory_region_init_ram(uc, ram, NULL, "pc.ram", size, perms, &error_abort);
if (ram->ram_addr == -1)
// out of memory
return NULL;
memory_region_add_subregion(get_system_memory(uc), begin, ram);