diff options
| author | Greg Clayton <gclayton@apple.com> | 2012-11-01 17:28:37 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2012-11-01 17:28:37 +0000 |
| commit | da2455bd45da380ae3f536bfe58c85bb1375fe4e (patch) | |
| tree | 855355e280dfc71bb77d00f7270e119636822822 /lldb | |
| parent | 531891e980dbdd82dd3052925fecf1bbcc1b25e9 (diff) | |
| download | bcm5719-llvm-da2455bd45da380ae3f536bfe58c85bb1375fe4e.tar.gz bcm5719-llvm-da2455bd45da380ae3f536bfe58c85bb1375fe4e.zip | |
Avoid a crash when trying to parse a line table in the DWARF parser.
llvm-svn: 167236
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 56689f58136..73f4166126b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -961,19 +961,21 @@ SymbolFileDWARF::ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpec { assert (sc.comp_unit); DWARFCompileUnit* dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); - assert (dwarf_cu); - const DWARFDebugInfoEntry * cu_die = dwarf_cu->GetCompileUnitDIEOnly(); - - if (cu_die) + if (dwarf_cu) { - const char * cu_comp_dir = cu_die->GetAttributeValueAsString(this, dwarf_cu, DW_AT_comp_dir, NULL); - dw_offset_t stmt_list = cu_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_stmt_list, DW_INVALID_OFFSET); + const DWARFDebugInfoEntry * cu_die = dwarf_cu->GetCompileUnitDIEOnly(); - // All file indexes in DWARF are one based and a file of index zero is - // supposed to be the compile unit itself. - support_files.Append (*sc.comp_unit); + if (cu_die) + { + const char * cu_comp_dir = cu_die->GetAttributeValueAsString(this, dwarf_cu, DW_AT_comp_dir, NULL); + dw_offset_t stmt_list = cu_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_stmt_list, DW_INVALID_OFFSET); - return DWARFDebugLine::ParseSupportFiles(sc.comp_unit->GetModule(), get_debug_line_data(), cu_comp_dir, stmt_list, support_files); + // All file indexes in DWARF are one based and a file of index zero is + // supposed to be the compile unit itself. + support_files.Append (*sc.comp_unit); + + return DWARFDebugLine::ParseSupportFiles(sc.comp_unit->GetModule(), get_debug_line_data(), cu_comp_dir, stmt_list, support_files); + } } return false; } |

