Skip to content
Snippets Groups Projects
Unverified Commit 4ce0a650 authored by Andrew Strelsky's avatar Andrew Strelsky
Browse files

prevent access violation from iob in Memory::IsValidVirtualAddress

parent 781c1d8d
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment