0x7F000000-0x7FFFFFFF is magic.

This commit is contained in:
gibbed 2015-05-22 02:20:05 -05:00
parent b74859dda3
commit ea99ba8e3b
2 changed files with 4 additions and 2 deletions

View File

@ -231,7 +231,7 @@ SHIM_CALL NtQueryVirtualMemory_shim(PPCContext* ppc_state, KernelState* state) {
auto heap = state->memory()->LookupHeap(base_address);
HeapAllocationInfo alloc_info;
if (!heap->QueryRegionInfo(base_address, &alloc_info)) {
if (heap == nullptr || !heap->QueryRegionInfo(base_address, &alloc_info)) {
SHIM_SET_RETURN_32(X_STATUS_INVALID_PARAMETER);
return;
}

View File

@ -270,8 +270,10 @@ void Memory::UnmapViews() {
BaseHeap* Memory::LookupHeap(uint32_t address) {
if (address < 0x40000000) {
return &heaps_.v00000000;
} else if (address < 0x80000000) {
} else if (address < 0x7F000000) {
return &heaps_.v40000000;
} else if (address < 0x80000000) {
return nullptr;
} else if (address < 0x90000000) {
return &heaps_.v80000000;
} else if (address < 0xA0000000) {