aboutsummaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-01-20 17:37:55 -0500
committerGitHub <noreply@github.com>2018-01-20 17:37:55 -0500
commiteea972611acebbe3f035c200113a44ab1089f1a3 (patch)
tree4d0cb1088d81c2115c2ad5ed53887681c0364b91 /src/core/memory.cpp
parentc8298b666ab8e40cb652ca50abc07cf0c59f969b (diff)
parentecc35e89e0736f5f08e9010726ef33b793d4045c (diff)
Merge pull request #120 from Rozelette/master
memory: Return false for large VAddr in IsValidVirtualAddress
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 74a5988523..a3d2d4951e 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;