plug memory leak in LLParser::PerFunctionState::SetInstName() by deleting a value...
authorNuno Lopes <nunoplopes@sapo.pt>
Wed, 2 Sep 2009 14:22:03 +0000 (14:22 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Wed, 2 Sep 2009 14:22:03 +0000 (14:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80790 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/LLParser.cpp

index 9424328910319cf930372615df6f8c3b2fd329ad..3d2e3125aa13bdd9a59e993bb09adde6c0db606d 100644 (file)
@@ -1701,6 +1701,7 @@ bool LLParser::PerFunctionState::SetInstName(int NameID,
       return P.Error(NameLoc, "instruction forward referenced with type '" + 
                      FI->second.first->getType()->getDescription() + "'");
     FI->second.first->replaceAllUsesWith(Inst);
+    delete FI->second.first;
     ForwardRefVals.erase(FI);
   }