forked from OSchip/llvm-project
[ELF] Dont release ownership of MemoryBuffer.
MemoryBuffer is being released too early. ELFFile owns MemoryBuffer. llvm-svn: 228260
This commit is contained in:
parent
c7f241cba9
commit
50ad727051
|
@ -45,7 +45,7 @@ protected:
|
|||
std::error_code doParse() override {
|
||||
std::error_code ec;
|
||||
_objFile.reset(
|
||||
new llvm::object::ELFFile<ELFT>(_mb.release()->getBuffer(), ec));
|
||||
new llvm::object::ELFFile<ELFT>(_mb->getBuffer(), ec));
|
||||
if (ec)
|
||||
return ec;
|
||||
|
||||
|
|
|
@ -420,7 +420,7 @@ ELFFile<ELFT>::create(std::unique_ptr<MemoryBuffer> mb, bool atomizeStrings) {
|
|||
template <class ELFT>
|
||||
std::error_code ELFFile<ELFT>::doParse() {
|
||||
std::error_code ec;
|
||||
_objFile.reset(new llvm::object::ELFFile<ELFT>(_mb.release()->getBuffer(), ec));
|
||||
_objFile.reset(new llvm::object::ELFFile<ELFT>(_mb->getBuffer(), ec));
|
||||
if (ec)
|
||||
return ec;
|
||||
|
||||
|
|
Loading…
Reference in New Issue