[lld] r286194 - [LTO] Don't leak BitcodeFiles. Found by the asan bot.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 17:46:02 PST 2016


Author: davide
Date: Mon Nov  7 19:46:02 2016
New Revision: 286194

URL: http://llvm.org/viewvc/llvm-project?rev=286194&view=rev
Log:
[LTO] Don't leak BitcodeFiles. Found by the asan bot.

Modified:
    lld/trunk/ELF/InputFiles.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=286194&r1=286193&r2=286194&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Mon Nov  7 19:46:02 2016
@@ -839,7 +839,7 @@ static bool isBitcode(MemoryBufferRef MB
 InputFile *elf::createObjectFile(MemoryBufferRef MB, StringRef ArchiveName,
                                  uint64_t OffsetInArchive) {
   InputFile *F =
-      isBitcode(MB) ? new BitcodeFile(MB) : createELFFile<ObjectFile>(MB);
+      isBitcode(MB) ? make<BitcodeFile>(MB) : createELFFile<ObjectFile>(MB);
   F->ArchiveName = ArchiveName;
   F->OffsetInArchive = OffsetInArchive;
   return F;




More information about the llvm-commits mailing list