summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAndrew Strelsky <ajs222@njit.edu>2021-09-29 13:54:59 +0200
committerAndrew Strelsky <ajs222@njit.edu>2021-09-30 01:26:44 +0200
commit4ce0a650d1931ad6f7f5f46c7e73a883821fd2b0 (patch)
tree97b193073228f55fe25772c661c6a3ed05e46453 /src/core
parentMerge pull request #7018 from lat9nq/splat-stubs (diff)
downloadyuzu-4ce0a650d1931ad6f7f5f46c7e73a883821fd2b0.tar
yuzu-4ce0a650d1931ad6f7f5f46c7e73a883821fd2b0.tar.gz
yuzu-4ce0a650d1931ad6f7f5f46c7e73a883821fd2b0.tar.bz2
yuzu-4ce0a650d1931ad6f7f5f46c7e73a883821fd2b0.tar.lz
yuzu-4ce0a650d1931ad6f7f5f46c7e73a883821fd2b0.tar.xz
yuzu-4ce0a650d1931ad6f7f5f46c7e73a883821fd2b0.tar.zst
yuzu-4ce0a650d1931ad6f7f5f46c7e73a883821fd2b0.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/memory.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 51c4dea26..88d6ec908 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -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;
}