[ob] Fix dwarf2 reader crash

Mark Kettenis
2007-01-28T14:42:38Z

DW_AT_decl_file can be zero, indicating no file. It's better not to
crash in that case.

Mark

Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>

* dwarf2read.c (new_symbol): Handle DW_AT_decl_file being zero.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.213
diff -u -p -r1.213 dwarf2read.c
--- dwarf2read.c 23 Jan 2007 23:57:47 -0000 1.213
+++ dwarf2read.c 28 Jan 2007 14:39:55 -0000
@@ -7079,7 +7079,7 @@ new_symbol (struct die_info *die, struct
|| file_index > cu->line_header->num_file_names)
complaint (&symfile_complaints,
_("file index out of range"));
- else
+ else if (file_index > 0)
{
struct file_entry *fe;
fe = &cu->line_header->file_names[file_index - 1];