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-on: https://gem5-review.googlesource.com/8261
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Rico Amslinger
2018-02-13 15:34:43 +01:00
parent 4e13495f5d
commit 8da5e6b8b6

View File

@@ -87,7 +87,7 @@ EmulationPageTable::remap(Addr vaddr, int64_t size, Addr new_vaddr)
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);
pTable.erase(old_it);
size -= pageSize;
vaddr += pageSize;