Plug a memory leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137321 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2011-08-11 18:39:28 +00:00
parent ae0bc5deaa
commit 0fa5e053a9

View File

@ -1046,18 +1046,18 @@ void DwarfDebug::endModule() {
LexicalScope *Scope = new LexicalScope(NULL, DIDescriptor(SP), NULL,
false);
DeadFnScopeMap[SP] = Scope;
SmallVector<DbgVariable *, 8> Variables;
SmallVector<DbgVariable, 8> Variables;
for (unsigned I = 0; I != E; ++I) {
DIVariable DV(NMD->getOperand(I));
if (!DV.Verify()) continue;
Variables.push_back(new DbgVariable(DV));
Variables.push_back(DbgVariable(DV));
}
// Construct subprogram DIE and add variables DIEs.
constructSubprogramDIE(SP);
DIE *ScopeDIE = getCompileUnit(SP)->getDIE(SP);
for (unsigned i = 0, N = Variables.size(); i < N; ++i) {
if (DIE *VariableDIE = constructVariableDIE(Variables[i], Scope))
if (DIE *VariableDIE = constructVariableDIE(&Variables[i], Scope))
ScopeDIE->addChild(VariableDIE);
}
}