From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12579 invoked by alias); 28 Jan 2007 14:42:38 -0000 Received: (qmail 12568 invoked by uid 22791); 28 Jan 2007 14:42:38 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 28 Jan 2007 14:42:33 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8) with ESMTP id l0SEgTWv012747 for ; Sun, 28 Jan 2007 15:42:29 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8/Submit) id l0SEgTlq019625; Sun, 28 Jan 2007 15:42:29 +0100 (CET) Date: Sun, 28 Jan 2007 14:42:00 -0000 Message-Id: <200701281442.l0SEgTlq019625@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: gdb-patches@sourceware.org Subject: [ob] Fix dwarf2 reader crash Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00567.txt.bz2 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 * 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];