diff options
-rw-r--r-- | lldb/include/lldb/Core/MappedHash.h | 6 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 3 |
3 files changed, 15 insertions, 0 deletions
diff --git a/lldb/include/lldb/Core/MappedHash.h b/lldb/include/lldb/Core/MappedHash.h index 5a52ab2b8b2..b7cf3b02e01 100644 --- a/lldb/include/lldb/Core/MappedHash.h +++ b/lldb/include/lldb/Core/MappedHash.h @@ -47,6 +47,9 @@ public: static uint32_t HashString (uint32_t hash_function, const char *s) { + if (!s) + return 0; + switch (hash_function) { case MappedHash::eHashFunctionDJB: @@ -434,6 +437,9 @@ public: bool Find (const char *name, Pair &pair) const { + if (!name || !name[0]) + return false; + if (IsValid ()) { const uint32_t bucket_count = m_header.bucket_count; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp index 0db416054ae..dc1d88fa9d3 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp @@ -671,6 +671,9 @@ DWARFMappedHash::MemoryTable::AppendAllDIEsInRange (const uint32_t die_offset_st size_t DWARFMappedHash::MemoryTable::FindByName (const char *name, DIEArray &die_offsets) { + if (!name || !name[0]) + return 0; + DIEInfoArray die_info_array; if (FindByName(name, die_info_array)) DWARFMappedHash::ExtractDIEArray (die_info_array, die_offsets); @@ -736,6 +739,9 @@ DWARFMappedHash::MemoryTable::FindCompleteObjCClassByName (const char *name, size_t DWARFMappedHash::MemoryTable::FindByName (const char *name, DIEInfoArray &die_info_array) { + if (!name || !name[0]) + return 0; + Pair kv_pair; size_t old_size = die_info_array.size(); if (Find (name, kv_pair)) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 2088864bf6b..36cedb1ac88 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -3124,6 +3124,9 @@ SymbolFileDWARF::FindTypes (const std::vector<CompilerContext> &context, ConstString name = context.back().name; + if (!name) + return 0; + if (m_using_apple_tables) { if (m_apple_types_ap.get()) |