[llvm-commits] [llvm] r80790 - /llvm/trunk/lib/AsmParser/LLParser.cpp

Nuno Lopes nunoplopes at sapo.pt
Wed Sep 2 07:22:03 PDT 2009


Author: nlopes
Date: Wed Sep  2 09:22:03 2009
New Revision: 80790

URL: http://llvm.org/viewvc/llvm-project?rev=80790&view=rev
Log:
plug memory leak in LLParser::PerFunctionState::SetInstName() by deleting a value after replacing it

Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=80790&r1=80789&r2=80790&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Wed Sep  2 09:22:03 2009
@@ -1701,6 +1701,7 @@
       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);
   }
   





More information about the llvm-commits mailing list