mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
Make vm::_test_map aware of overflow
+ remove vm::find_map 1024mb limit.
This commit is contained in:
parent
fd09dde911
commit
bbbd06dcee
1 changed files with 12 additions and 4 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include "Utilities/cond.h"
|
#include "Utilities/cond.h"
|
||||||
#include "Utilities/Thread.h"
|
#include "Utilities/Thread.h"
|
||||||
#include "Utilities/VirtualMemory.h"
|
#include "Utilities/VirtualMemory.h"
|
||||||
|
#include "Utilities/address_range.h"
|
||||||
#include "Utilities/asm.h"
|
#include "Utilities/asm.h"
|
||||||
#include "Emu/CPU/CPUThread.h"
|
#include "Emu/CPU/CPUThread.h"
|
||||||
#include "Emu/Cell/lv2/sys_memory.h"
|
#include "Emu/Cell/lv2/sys_memory.h"
|
||||||
|
@ -888,14 +889,21 @@ namespace vm
|
||||||
|
|
||||||
static bool _test_map(u32 addr, u32 size)
|
static bool _test_map(u32 addr, u32 size)
|
||||||
{
|
{
|
||||||
for (auto& block : g_locations)
|
const auto range = utils::address_range::start_length(addr, size);
|
||||||
{
|
|
||||||
if (block && block->addr >= addr && block->addr <= addr + size - 1)
|
if (!range.valid())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block && addr >= block->addr && addr <= block->addr + block->size - 1)
|
for (auto& block : g_locations)
|
||||||
|
{
|
||||||
|
if (!block)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (range.overlaps(utils::address_range::start_length(block->addr, block->size)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -990,7 +998,7 @@ namespace vm
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return if size is invalid
|
// Return if size is invalid
|
||||||
if (!size || size > 0x40000000)
|
if (!size)
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue