diff options
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r-- | lld/ELF/InputSection.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 83fb3aa601b..9823f4adfd1 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -13,6 +13,7 @@ #include "Error.h" #include "InputFiles.h" #include "LinkerScript.h" +#include "Memory.h" #include "OutputSections.h" #include "SyntheticSections.h" #include "Target.h" @@ -167,11 +168,10 @@ template <class ELFT> void InputSectionBase<ELFT>::uncompress() { std::tie(Buf, Size) = getRawCompressedData(Data); // Uncompress Buf. - UncompressedData.reset(new uint8_t[Size]); - if (zlib::uncompress(toStringRef(Buf), (char *)UncompressedData.get(), - Size) != zlib::StatusOK) + char *OutputBuf = BAlloc.Allocate<char>(Size); + if (zlib::uncompress(toStringRef(Buf), OutputBuf, Size) != zlib::StatusOK) fatal(getName(this) + ": error while uncompressing section"); - Data = ArrayRef<uint8_t>(UncompressedData.get(), Size); + Data = ArrayRef<uint8_t>((uint8_t *)OutputBuf, Size); } template <class ELFT> |