+2002-08-20 David Carlton <carlton@math.stanford.edu>
+
+ * dwarf2read.c (dwarf2_build_psymtabs): Check that
+ dwarf_line_offset is nonzero before creating dwarf_line_buffer.
+ (read_file_scope): Check that line_header is nonzero before
+ decoding macro information.
+
2002-08-20 Mark Kettenis <kettenis@gnu.org>
* i386-tdep.h (FP_REGNUM_P): Change such that we don't incorrectly
dwarf_abbrev_buffer = dwarf2_read_section (objfile,
dwarf_abbrev_offset,
dwarf_abbrev_size);
- dwarf_line_buffer = dwarf2_read_section (objfile,
- dwarf_line_offset,
- dwarf_line_size);
+
+ if (dwarf_line_offset)
+ dwarf_line_buffer = dwarf2_read_section (objfile,
+ dwarf_line_offset,
+ dwarf_line_size);
+ else
+ dwarf_line_buffer = NULL;
if (dwarf_str_offset)
dwarf_str_buffer = dwarf2_read_section (objfile,
header, so we can only read it if we've read the header
successfully. */
attr = dwarf_attr (die, DW_AT_macro_info);
- if (attr)
+ if (attr && line_header)
{
unsigned int macro_offset = DW_UNSND (attr);
dwarf_decode_macros (line_header, macro_offset,