Remove null checks of results of new expressions

operator new doesn't return a null pointer, even if one turns off
exceptions (it calls std::terminate instead). Therefore, all of this is
dead code.

llvm-svn: 364744
This commit is contained in:
Pavel Labath
2019-07-01 11:09:15 +00:00
parent ed13fef477
commit 0f73709cb7
15 changed files with 15 additions and 52 deletions

View File

@@ -246,14 +246,12 @@ size_t ObjectFileJIT::ReadSectionData(
if (section->GetFileSize()) {
const void *src = (void *)(uintptr_t)section->GetFileOffset();
DataBufferSP data_sp(
new lldb_private::DataBufferHeap(src, section->GetFileSize()));
if (data_sp) {
section_data.SetData(data_sp, 0, data_sp->GetByteSize());
section_data.SetByteOrder(GetByteOrder());
section_data.SetAddressByteSize(GetAddressByteSize());
return section_data.GetByteSize();
}
DataBufferSP data_sp =
std::make_shared<DataBufferHeap>(src, section->GetFileSize());
section_data.SetData(data_sp, 0, data_sp->GetByteSize());
section_data.SetByteOrder(GetByteOrder());
section_data.SetAddressByteSize(GetAddressByteSize());
return section_data.GetByteSize();
}
section_data.Clear();
return 0;