forked from OSchip/llvm-project
parent
e7a60708ff
commit
17e93d28f2
|
@ -200,12 +200,12 @@ void InputSectionBase::uncompress() {
|
|||
Config->IsLE, Config->Is64));
|
||||
|
||||
size_t Size = Dec.getDecompressedSize();
|
||||
UncompressBuf.reset(new std::vector<uint8_t>(Size));
|
||||
if (Error E = Dec.decompress({(char *)UncompressBuf->data(), Size}))
|
||||
UncompressBuf.reset(new char[Size]());
|
||||
if (Error E = Dec.decompress({UncompressBuf.get(), Size}))
|
||||
fatal(toString(this) +
|
||||
": decompress failed: " + llvm::toString(std::move(E)));
|
||||
|
||||
this->Data = *UncompressBuf;
|
||||
this->Data = makeArrayRef((uint8_t *)UncompressBuf.get(), Size);
|
||||
this->Flags &= ~(uint64_t)SHF_COMPRESSED;
|
||||
}
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ public:
|
|||
private:
|
||||
// A pointer that owns uncompressed data if a section is compressed by zlib.
|
||||
// Since the feature is not used often, this is usually a nullptr.
|
||||
std::unique_ptr<std::vector<uint8_t>> UncompressBuf;
|
||||
std::unique_ptr<char[]> UncompressBuf;
|
||||
};
|
||||
|
||||
// SectionPiece represents a piece of splittable section contents.
|
||||
|
|
Loading…
Reference in New Issue