diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 94243289103..3d2e3125aa1 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -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); }