[llvm-commits] [llvm] r168622 - /llvm/trunk/lib/CodeGen/MachineCSE.cpp
Jakub Staszak
kubastaszak at gmail.com
Mon Nov 26 14:14:19 PST 2012
Author: kuba
Date: Mon Nov 26 16:14:19 2012
New Revision: 168622
URL: http://llvm.org/viewvc/llvm-project?rev=168622&view=rev
Log:
Don't use iterator after being erased.
Modified:
llvm/trunk/lib/CodeGen/MachineCSE.cpp
Modified: llvm/trunk/lib/CodeGen/MachineCSE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCSE.cpp?rev=168622&r1=168621&r2=168622&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineCSE.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineCSE.cpp Mon Nov 26 16:14:19 2012
@@ -429,8 +429,8 @@
DEBUG(dbgs() << "Exiting: " << MBB->getName() << '\n');
DenseMap<MachineBasicBlock*, ScopeType*>::iterator SI = ScopeMap.find(MBB);
assert(SI != ScopeMap.end());
- ScopeMap.erase(SI);
delete SI->second;
+ ScopeMap.erase(SI);
}
bool MachineCSE::ProcessBlock(MachineBasicBlock *MBB) {
More information about the llvm-commits
mailing list