Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: gdb-patches@sourceware.org
Subject: [ob] Fix dwarf2 reader crash
Date: Sun, 28 Jan 2007 14:42:00 -0000	[thread overview]
Message-ID: <200701281442.l0SEgTlq019625@brahms.sibelius.xs4all.nl> (raw)

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];


             reply	other threads:[~2007-01-28 14:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-28 14:42 Mark Kettenis [this message]
2007-01-28 14:44 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200701281442.l0SEgTlq019625@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox