fix flushAddr so it doesn't modify an iterator that has been deleted

--HG--
extra : convert_revision : 8b7e4948974517b13616ab782aa7e84471b24f10
This commit is contained in:
Ali Saidi 2007-05-01 18:12:58 -04:00
parent e0f8e57a7f
commit 39743d35a3

View file

@ -213,7 +213,7 @@ TLB::flushAddr(Addr addr, uint8_t asn)
if (i == lookupTable.end())
return;
while (i->first == vaddr.vpn()) {
while (i != lookupTable.end() && i->first == vaddr.vpn()) {
int index = i->second;
PTE *pte = &table[index];
assert(pte->valid);
@ -225,10 +225,10 @@ TLB::flushAddr(Addr addr, uint8_t asn)
// invalidate this entry
pte->valid = false;
lookupTable.erase(i);
lookupTable.erase(i++);
} else {
++i;
}
++i;
}
}