From ec9b896fbf6339911b9b8dd1b2feae88ca68df96 Mon Sep 17 00:00:00 2001 From: Eladash Date: Tue, 20 Aug 2019 23:18:54 +0300 Subject: [PATCH] Fix vm::reserve_map logic --- rpcs3/Emu/Memory/vm.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index 73dde1bc1d..d49ba517bd 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -1060,16 +1060,7 @@ namespace vm } lock.upgrade(); - - // Fixed allocation - if (addr) - { - // Recheck - area = _get_map(location, addr); - - return !area ? _map(addr, area_size, flags) : area; - } - + // Allocation on arbitrary address if (location != any && location < g_locations.size()) { @@ -1085,7 +1076,10 @@ namespace vm return loc; } - return nullptr; + // Fixed address allocation + area = _get_map(location, addr); + + return !area ? _map(addr, area_size, flags) : area; } inline namespace ps3_