mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-28 21:27:02 +00:00
memory: Fix bad error handling in memory_region_init_ram_ptr()
Commit ef701d7 screwed up handling of out-of-memory conditions. Before the commit, we report the error and exit(1), in one place. The commit lifts the error handling up the call chain some, to three places. Fine. Except it uses &error_abort in these places, changing the behavior from exit(1) to abort(), and thus undoing the work of commit 3922825 "exec: Don't abort when we can't allocate guest memory". The previous two commits fixed one of the three places, another one was fixed in commit 33e0eb5. This commit fixes the third one. Backports commit 0bdaa3a429c6d07cd437b442a1f15f70be1addaa from qemu
This commit is contained in:
parent
0201c71145
commit
9bc51db79d
|
@ -1185,7 +1185,7 @@ void memory_region_init_ram_ptr(struct uc_struct *uc, MemoryRegion *mr,
|
|||
|
||||
/* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL. */
|
||||
assert(ptr != NULL);
|
||||
mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_abort);
|
||||
mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal);
|
||||
}
|
||||
|
||||
void memory_region_init_resizeable_ram(struct uc_struct *uc,
|
||||
|
|
Loading…
Reference in a new issue