plug memory leak in LLParser::PerFunctionState::SetInstName() by deleting a value after replacing it

llvm-svn: 80790
This commit is contained in:
Nuno Lopes 2009-09-02 14:22:03 +00:00
parent ae866b0c66
commit 2fcee70aeb
1 changed files with 1 additions and 0 deletions

View 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);
}