diff options
author | bunnei <bunneidev@gmail.com> | 2018-01-20 23:37:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-20 23:37:55 +0100 |
commit | 6cccbf0eb365c9918e09a4965d46e9252c8ec6c4 (patch) | |
tree | 4d0cb1088d81c2115c2ad5ed53887681c0364b91 /src/core | |
parent | Merge pull request #119 from bunnei/desconstucted-loader (diff) | |
parent | memory: Return false for large VAddr in IsValidVirtualAddress (diff) | |
download | yuzu-6cccbf0eb365c9918e09a4965d46e9252c8ec6c4.tar yuzu-6cccbf0eb365c9918e09a4965d46e9252c8ec6c4.tar.gz yuzu-6cccbf0eb365c9918e09a4965d46e9252c8ec6c4.tar.bz2 yuzu-6cccbf0eb365c9918e09a4965d46e9252c8ec6c4.tar.lz yuzu-6cccbf0eb365c9918e09a4965d46e9252c8ec6c4.tar.xz yuzu-6cccbf0eb365c9918e09a4965d46e9252c8ec6c4.tar.zst yuzu-6cccbf0eb365c9918e09a4965d46e9252c8ec6c4.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/memory.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 74a598852..a3d2d4951 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -219,6 +219,9 @@ void Write(const VAddr vaddr, const T data) { bool IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) { auto& page_table = process.vm_manager.page_table; + if ((vaddr >> PAGE_BITS) >= PAGE_TABLE_NUM_ENTRIES) + return false; + const u8* page_pointer = page_table.pointers[vaddr >> PAGE_BITS]; if (page_pointer) return true; |