diff options
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 4 | ||||
| -rw-r--r-- | lld/ELF/InputFiles.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 8256b3bfd9a..4d11f359374 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -268,8 +268,8 @@ elf::ObjectFile<ELFT>::createInputSection(const Elf_Shdr &Sec) { // A MIPS object file has a special section that contains register // usage info, which needs to be handled by the linker specially. if (Config->EMachine == EM_MIPS && Name == ".reginfo") { - MipsReginfo = new (Alloc) MipsReginfoInputSection<ELFT>(this, &Sec); - return MipsReginfo; + MipsReginfo.reset(new MipsReginfoInputSection<ELFT>(this, &Sec)); + return MipsReginfo.get(); } // We dont need special handling of .eh_frame sections if relocatable diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h index bae552d89fc..1ed47c8f3f5 100644 --- a/lld/ELF/InputFiles.h +++ b/lld/ELF/InputFiles.h @@ -146,7 +146,7 @@ private: std::vector<SymbolBody *> SymbolBodies; // MIPS .reginfo section defined by this file. - MipsReginfoInputSection<ELFT> *MipsReginfo = nullptr; + std::unique_ptr<MipsReginfoInputSection<ELFT>> MipsReginfo; llvm::BumpPtrAllocator Alloc; llvm::SpecificBumpPtrAllocator<InputSection<ELFT>> IAlloc; |

