forked from OSchip/llvm-project
Fix the last leak asan found in test/ELF.
llvm-svn: 256316
This commit is contained in:
parent
d23b4000c2
commit
ce7d39d5e1
|
@ -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;
|
||||
|
|
|
@ -136,6 +136,7 @@ private:
|
|||
|
||||
llvm::BumpPtrAllocator Alloc;
|
||||
llvm::SpecificBumpPtrAllocator<MergeInputSection<ELFT>> MAlloc;
|
||||
llvm::SpecificBumpPtrAllocator<EHInputSection<ELFT>> EHAlloc;
|
||||
};
|
||||
|
||||
class ArchiveFile : public InputFile {
|
||||
|
|
Loading…
Reference in New Issue