diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2008-10-03 15:51:46 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2008-10-03 15:51:46 +0000 |
commit | aa1aee3e958ef1589530ea7b43ef1997d373347e (patch) | |
tree | 191cf806345c0c514b49bafa46e7beb4cdaa9f03 | |
parent | 9e9631dae92e9ef5d26522078225cd0e4ed43954 (diff) |
fix more memleaks in ResolveTypeTo() and ParseGlobalVariable()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57008 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 1a8458409b..608ed721f7 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -707,6 +707,7 @@ static void ResolveTypeTo(std::string *Name, const Type *ToTy) { ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy); CurModule.LateResolveTypes.erase(I); } + D.destroy(); } // setValueName - Set the specified value to the name given. The name may be @@ -782,9 +783,12 @@ ParseGlobalVariable(std::string *NameStr, GV->setConstant(isConstantGlobal); GV->setThreadLocal(IsThreadLocal); InsertValue(GV, CurModule.Values); + ID.destroy(); return GV; } + ID.destroy(); + // If this global has a name if (!Name.empty()) { // if the global we're parsing has an initializer (is a definition) and |