diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2007-05-01 18:12:58 -0400 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2007-05-01 18:12:58 -0400 |
commit | 39743d35a3dbe5b46e5051ade5394518cef8de9e (patch) | |
tree | 2ef7a3bc5f45506ea822844d671ff2da5a9bd879 /src/arch/alpha | |
parent | e0f8e57a7fcef1ee48ae1f73f825b59c7e8fd445 (diff) | |
download | gem5-39743d35a3dbe5b46e5051ade5394518cef8de9e.tar.xz |
fix flushAddr so it doesn't modify an iterator that has been deleted
--HG--
extra : convert_revision : 8b7e4948974517b13616ab782aa7e84471b24f10
Diffstat (limited to 'src/arch/alpha')
-rw-r--r-- | src/arch/alpha/tlb.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/alpha/tlb.cc b/src/arch/alpha/tlb.cc index 3ab65e664..2dfff8c5f 100644 --- a/src/arch/alpha/tlb.cc +++ b/src/arch/alpha/tlb.cc @@ -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; } } |