summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-07-01 11:09:15 +0000
committerPavel Labath <pavel@labath.sk>2019-07-01 11:09:15 +0000
commit0f73709cb7166c74c491a4dbdb32ec81c1990a3a (patch)
tree8270fe9fc3fbbe0260a5c87ca6fdefd7f0452e2a /lldb/source/Plugins/ObjectFile
parented13fef47741d0a8fcaefeedbe6dc47a8552b928 (diff)
downloadbcm5719-llvm-0f73709cb7166c74c491a4dbdb32ec81c1990a3a.tar.gz
bcm5719-llvm-0f73709cb7166c74c491a4dbdb32ec81c1990a3a.zip
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
Diffstat (limited to 'lldb/source/Plugins/ObjectFile')
-rw-r--r--lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
index 7d7453c0a87..eaf973da383 100644
--- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
+++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
@@ -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;
OpenPOWER on IntegriCloud