mem, sim-se: Fixed seg-fault in EmulationPageTable::remap

When moving a memory region the target region should be unmapped.
The assertion does reflect this, but the following line accesses
the invalid pointer regardless. This commit replaces the pointer
access with an emplace.

Change-Id: I85f9be4e6c223eab447c75043e593ed3f90017e1
Reviewed-by: Gabe Black <>
Reviewed-by: Brandon Potter <>
Maintainer: Gabe Black <>
diff --git a/src/mem/ b/src/mem/
index 8a11ada..cd34225 100644
--- a/src/mem/
+++ b/src/mem/
@@ -87,7 +87,7 @@
         auto old_it = pTable.find(vaddr);
         assert(old_it != pTable.end() && new_it == pTable.end());
-        new_it->second = old_it->second;
+        pTable.emplace(new_vaddr, old_it->second);
         size -= pageSize;
         vaddr += pageSize;