[lld] r256316 - Fix the last leak asan found in test/ELF.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 19:40:18 PST 2015


Author: rafael
Date: Tue Dec 22 21:40:17 2015
New Revision: 256316

URL: http://llvm.org/viewvc/llvm-project?rev=256316&view=rev
Log:
Fix the last leak asan found in test/ELF.

Modified:
    lld/trunk/ELF/InputFiles.cpp
    lld/trunk/ELF/InputFiles.h

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=256316&r1=256315&r2=256316&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Tue Dec 22 21:40:17 2015
@@ -233,12 +233,14 @@ void elf2::ObjectFile<ELFT>::initializeS
       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;

Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=256316&r1=256315&r2=256316&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Tue Dec 22 21:40:17 2015
@@ -136,6 +136,7 @@ private:
 
   llvm::BumpPtrAllocator Alloc;
   llvm::SpecificBumpPtrAllocator<MergeInputSection<ELFT>> MAlloc;
+  llvm::SpecificBumpPtrAllocator<EHInputSection<ELFT>> EHAlloc;
 };
 
 class ArchiveFile : public InputFile {




More information about the llvm-commits mailing list