From 51820691e77b816da7d4d66de68e3c0b79f2781a Mon Sep 17 00:00:00 2001
From: Yuri Kunde Schlesner <yuriks@yuriks.net>
Date: Thu, 9 Jul 2015 22:47:27 -0300
Subject: Memory: Fix unmapping of pages

---
 src/core/memory.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'src/core/memory.cpp')

diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 172ae90546..1f66bb27d6 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) {
     while (base != end) {
         ASSERT_MSG(base < PageTable::NUM_ENTRIES, "out of range mapping at %08X", base);
 
-        if (current_page_table->attributes[base] != PageType::Unmapped && type != PageType::Unmapped) {
-            LOG_ERROR(HW_Memory, "overlapping memory ranges at %08X", base * PAGE_SIZE);
-        }
         current_page_table->attributes[base] = type;
         current_page_table->pointers[base] = memory;
 
         base += 1;
-        memory += PAGE_SIZE;
+        if (memory != nullptr)
+            memory += PAGE_SIZE;
     }
 }
 
-- 
cgit v1.2.3-70-g09d2