Don't use iterator after being erased.

llvm-svn: 168622
This commit is contained in:
Jakub Staszak 2012-11-26 22:14:19 +00:00
parent 05c1f00cae
commit f18753b8d0
1 changed files with 1 additions and 1 deletions

View File

@ -429,8 +429,8 @@ void MachineCSE::ExitScope(MachineBasicBlock *MBB) {
DEBUG(dbgs() << "Exiting: " << MBB->getName() << '\n'); DEBUG(dbgs() << "Exiting: " << MBB->getName() << '\n');
DenseMap<MachineBasicBlock*, ScopeType*>::iterator SI = ScopeMap.find(MBB); DenseMap<MachineBasicBlock*, ScopeType*>::iterator SI = ScopeMap.find(MBB);
assert(SI != ScopeMap.end()); assert(SI != ScopeMap.end());
ScopeMap.erase(SI);
delete SI->second; delete SI->second;
ScopeMap.erase(SI);
} }
bool MachineCSE::ProcessBlock(MachineBasicBlock *MBB) { bool MachineCSE::ProcessBlock(MachineBasicBlock *MBB) {