From f18753b8d0af54683d487546ab24028d6da5c9f1 Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Mon, 26 Nov 2012 22:14:19 +0000 Subject: [PATCH] Don't use iterator after being erased. llvm-svn: 168622 --- llvm/lib/CodeGen/MachineCSE.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp index 497e000b6872..dbc41defeb5a 100644 --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -429,8 +429,8 @@ void MachineCSE::ExitScope(MachineBasicBlock *MBB) { DEBUG(dbgs() << "Exiting: " << MBB->getName() << '\n'); DenseMap::iterator SI = ScopeMap.find(MBB); assert(SI != ScopeMap.end()); - ScopeMap.erase(SI); delete SI->second; + ScopeMap.erase(SI); } bool MachineCSE::ProcessBlock(MachineBasicBlock *MBB) {