Fix an iterator invalidation problem in code used by the -strip pass
authorChris Lattner <sabre@nondot.org>
Mon, 31 Oct 2005 18:42:37 +0000 (18:42 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 31 Oct 2005 18:42:37 +0000 (18:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24124 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/SymbolTable.cpp

index 3290fbd37a7233bbae840be3ade16287c70cce8a..3ac8ddfc6ad2c5e26a8ca81ff6b579773b77ba5c 100644 (file)
@@ -269,12 +269,12 @@ bool SymbolTable::strip() {
     value_iterator B = Plane.begin(), Bend = Plane.end();
     while (B != Bend) {   // Found nonempty type plane!
       Value *V = B->second;
+      ++B;
       if (!isa<GlobalValue>(V) || cast<GlobalValue>(V)->hasInternalLinkage()) {
         // Set name to "", removing from symbol table!
         V->setName("");
         RemovedSymbol = true;
       }
-      ++B;
     }
   }