need some initializations before doing the loop.
authorLisa Hsu <hsul@eecs.umich.edu>
Wed, 18 Oct 2006 22:01:33 +0000 (18:01 -0400)
committerLisa Hsu <hsul@eecs.umich.edu>
Wed, 18 Oct 2006 22:01:33 +0000 (18:01 -0400)
--HG--
extra : convert_revision : e5e8b16ae4f119c923d8c0d295aa9569d7a8fe5b

src/mem/page_table.cc

index 32da4282ceda9eed57dc5d0dde89318d8b671120..fa6d5ddfb4579635462236f446f9ab8fd59a2f8c 100644 (file)
@@ -167,13 +167,14 @@ void
 PageTable::serialize(std::ostream &os)
 {
     paramOut(os, "ptable.size", pTable.size());
+
     int count = 0;
 
     m5::hash_map<Addr,Addr>::iterator iter;
-    while (iter != pTable.end()) {
+    m5::hash_map<Addr,Addr>::iterator end;
+    for (iter = pTable.begin(); iter != end; ++iter,++count) {
         paramOut(os, csprintf("ptable.entry%dvaddr", count),iter->first);
         paramOut(os, csprintf("ptable.entry%dpaddr", count),iter->second);
-        ++count;
     }
     assert(count == pTable.size());
 }