summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2016-01-14 18:59:49 +0000
committerSean Callanan <scallanan@apple.com>2016-01-14 18:59:49 +0000
commit9b0cfe25107d0b1ac08fea712a909c988eb4cc09 (patch)
treeabdb08ce294472238af4fc7e063066a59f2e11d8 /lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
parent5535c5160675b720fc636a94c64685fc9be9e9ad (diff)
downloadbcm5719-llvm-9b0cfe25107d0b1ac08fea712a909c988eb4cc09.tar.gz
bcm5719-llvm-9b0cfe25107d0b1ac08fea712a909c988eb4cc09.zip
Fixed a crasher when dealing with table entries that have blank names.
This can happen with -gmodules tables when an anonymous struct is referred to. llvm-svn: 257786
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp6
1 files changed, 6 insertions, 0 deletions
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))
OpenPOWER on IntegriCloud