Rico Amslinger merged this change by Rico Amslinger. ( https://gem5-review.googlesource.com/8261 )

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

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 <gabebl...@google.com>
Reviewed-by: Brandon Potter <brandon.pot...@amd.com>
Maintainer: Gabe Black <gabebl...@google.com>
---
M src/mem/page_table.cc
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Brandon Potter: Looks good to me, approved
  Gabe Black: Looks good to me, approved; Looks good to me, approved



diff --git a/src/mem/page_table.cc b/src/mem/page_table.cc
index 8a11ada..cd34225 100644
--- a/src/mem/page_table.cc
+++ b/src/mem/page_table.cc
@@ -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);
         pTable.erase(old_it);
         size -= pageSize;
         vaddr += pageSize;

--
To view, visit https://gem5-review.googlesource.com/8261
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I85f9be4e6c223eab447c75043e593ed3f90017e1
Gerrit-Change-Number: 8261
Gerrit-PatchSet: 2
Gerrit-Owner: Rico Amslinger <rico.amslin...@informatik.uni-augsburg.de>
Gerrit-Reviewer: Brandon Potter <brandon.pot...@amd.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Rico Amslinger <rico.amslin...@informatik.uni-augsburg.de>
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to