set permission for memory region allocated by memory_map_ptr(). this fixes the segfault in sample_x86.c, function test_x86_map_ptr()

This commit is contained in:
Nguyen Anh Quynh 2015-11-28 17:11:27 +08:00
parent 8f1e8c0ab1
commit 4a759cebb5

View file

@ -53,6 +53,7 @@ MemoryRegion *memory_map_ptr(struct uc_struct *uc, ram_addr_t begin, size_t size
MemoryRegion *ram = g_new(MemoryRegion, 1);
memory_region_init_ram_ptr(uc, ram, NULL, "pc.ram", size, ptr);
ram->perms = UC_PROT_ALL;
if (ram->ram_addr == -1)
// out of memory
return NULL;