summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-07-09 22:47:27 -0300
committerGravatar Yuri Kunde Schlesner2015-07-11 23:49:53 -0300
commit51820691e77b816da7d4d66de68e3c0b79f2781a (patch)
treebb84275d0a15650f3be8e428f2cce348cebe4ff9 /src
parentLoader: Clean up 3dsx loader a bit, fixing a potential buffer overrun (diff)
downloadyuzu-51820691e77b816da7d4d66de68e3c0b79f2781a.tar.gz
yuzu-51820691e77b816da7d4d66de68e3c0b79f2781a.tar.xz
yuzu-51820691e77b816da7d4d66de68e3c0b79f2781a.zip
Memory: Fix unmapping of pages
Diffstat (limited to 'src')
-rw-r--r--src/core/memory.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 172ae9054..1f66bb27d 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -59,14 +59,12 @@ static void MapPages(u32 base, u32 size, u8* memory, PageType type) {
59 while (base != end) { 59 while (base != end) {
60 ASSERT_MSG(base < PageTable::NUM_ENTRIES, "out of range mapping at %08X", base); 60 ASSERT_MSG(base < PageTable::NUM_ENTRIES, "out of range mapping at %08X", base);
61 61
62 if (current_page_table->attributes[base] != PageType::Unmapped && type != PageType::Unmapped) {
63 LOG_ERROR(HW_Memory, "overlapping memory ranges at %08X", base * PAGE_SIZE);
64 }
65 current_page_table->attributes[base] = type; 62 current_page_table->attributes[base] = type;
66 current_page_table->pointers[base] = memory; 63 current_page_table->pointers[base] = memory;
67 64
68 base += 1; 65 base += 1;
69 memory += PAGE_SIZE; 66 if (memory != nullptr)
67 memory += PAGE_SIZE;
70 } 68 }
71} 69}
72 70