Fix the last leak asan found in test/ELF.

llvm-svn: 256316
This commit is contained in:
Rafael Espindola 2015-12-23 03:40:17 +00:00
parent d23b4000c2
commit ce7d39d5e1
2 changed files with 5 additions and 2 deletions

View File

@ -233,12 +233,14 @@ void elf2::ObjectFile<ELFT>::initializeSections(DenseSet<StringRef> &Comdats) {
if (Name == ".note.GNU-stack")
Sections[I] = &InputSection<ELFT>::Discarded;
else if (Name == ".eh_frame")
Sections[I] = new (this->Alloc) EHInputSection<ELFT>(this, &Sec);
Sections[I] =
new (this->EHAlloc.Allocate()) EHInputSection<ELFT>(this, &Sec);
else if (Name == ".reginfo")
Sections[I] =
new (this->Alloc) MipsReginfoInputSection<ELFT>(this, &Sec);
else if (shouldMerge<ELFT>(Sec))
Sections[I] = new (this->MAlloc.Allocate()) MergeInputSection<ELFT>(this, &Sec);
Sections[I] =
new (this->MAlloc.Allocate()) MergeInputSection<ELFT>(this, &Sec);
else
Sections[I] = new (this->Alloc) InputSection<ELFT>(this, &Sec);
break;

View File

@ -136,6 +136,7 @@ private:
llvm::BumpPtrAllocator Alloc;
llvm::SpecificBumpPtrAllocator<MergeInputSection<ELFT>> MAlloc;
llvm::SpecificBumpPtrAllocator<EHInputSection<ELFT>> EHAlloc;
};
class ArchiveFile : public InputFile {