mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 08:15:37 +00:00
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:
parent
8f1e8c0ab1
commit
4a759cebb5
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue