[Lldb-commits] [lldb] r140917 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
Jason Molenda
jmolenda at apple.com
Fri Sep 30 18:28:37 PDT 2011
Author: jmolenda
Date: Fri Sep 30 20:28:37 2011
New Revision: 140917
URL: http://llvm.org/viewvc/llvm-project?rev=140917&view=rev
Log:
Fix segfault in UniqueDWARFASTTypeList::Find if we are comparing
an anonymous struct type (which lacks any name).
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp?rev=140917&r1=140916&r2=140917&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp Fri Sep 30 20:28:37 2011
@@ -59,9 +59,16 @@
case DW_TAG_namespace:
{
const char *parent_arg_die_name = parent_arg_die->GetName(symfile, cu);
- const char *parent_pos_die_name = parend_pos_die->GetName(pos->m_symfile, pos->m_cu);
- if (strcmp (parent_arg_die_name, parent_pos_die_name))
+ if (parent_arg_die_name == NULL) // Anonymous (i.e. no-name) struct
+ {
match = false;
+ }
+ else
+ {
+ const char *parent_pos_die_name = parend_pos_die->GetName(pos->m_symfile, pos->m_cu);
+ if (parent_pos_die_name == NULL || strcmp (parent_arg_die_name, parent_pos_die_name))
+ match = false;
+ }
}
break;
More information about the lldb-commits
mailing list