1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

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 34150f5680
commit f00826065d

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