mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 04:46:27 -05:00
prevent access violation from iob in Memory::IsValidVirtualAddress
This commit is contained in:
parent
781c1d8df8
commit
4ce0a650d1
1 changed files with 5 additions and 1 deletions
|
@ -587,7 +587,11 @@ void Memory::UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) {
|
|||
bool Memory::IsValidVirtualAddress(const VAddr vaddr) const {
|
||||
const Kernel::KProcess& process = *system.CurrentProcess();
|
||||
const auto& page_table = process.PageTable().PageTableImpl();
|
||||
const auto [pointer, type] = page_table.pointers[vaddr >> PAGE_BITS].PointerType();
|
||||
const size_t page = vaddr >> PAGE_BITS;
|
||||
if (page >= page_table.pointers.size()) {
|
||||
return false;
|
||||
}
|
||||
const auto [pointer, type] = page_table.pointers[page].PointerType();
|
||||
return pointer != nullptr || type == Common::PageType::RasterizerCachedMemory;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue