From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1860 invoked by alias); 11 Aug 2007 20:53:19 -0000 Received: (qmail 1708 invoked by uid 22791); 11 Aug 2007 20:53:18 -0000 X-Spam-Check-By: sourceware.org Received: from b.mail.sonic.net (HELO b.mail.sonic.net) (64.142.19.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 11 Aug 2007 20:53:17 +0000 Received: from webmail.sonic.net (b.webmail.sonic.net [64.142.100.148]) by b.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id l7BKrFU3029998 for ; Sat, 11 Aug 2007 13:53:15 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Sat, 11 Aug 2007 13:53:15 -0700 (PDT) Message-ID: <25041.12.7.175.2.1186865595.squirrel@webmail.sonic.net> Date: Sat, 11 Aug 2007 20:53:00 -0000 Subject: [PATCH] source.c, find_source_lines From: msnyder@sonic.net To: gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20070811135315_11688" 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-08/txt/msg00247.txt.bz2 ------=_20070811135315_11688 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 103 Since 's' is repeatedly assumed, let's assert it rather than sometimes checking it and sometimes not. ------=_20070811135315_11688 Content-Type: text/plain; name="57.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="57.txt" Content-length: 1145 2007-08-11 Michael Snyder * source.c (find_source_lines): Require symtab 's'. Index: source.c =================================================================== RCS file: /cvs/src/src/gdb/source.c,v retrieving revision 1.80 diff -p -r1.80 source.c *** source.c 28 Jun 2007 22:14:06 -0000 1.80 --- source.c 11 Aug 2007 20:46:35 -0000 *************** find_source_lines (struct symtab *s, int *** 1122,1132 **** long mtime = 0; int size; line_charpos = (int *) xmalloc (lines_allocated * sizeof (int)); if (fstat (desc, &st) < 0) perror_with_name (s->filename); ! if (s && s->objfile && s->objfile->obfd) mtime = bfd_get_mtime (s->objfile->obfd); else if (exec_bfd) mtime = bfd_get_mtime (exec_bfd); --- 1122,1133 ---- long mtime = 0; int size; + gdb_assert (s); line_charpos = (int *) xmalloc (lines_allocated * sizeof (int)); if (fstat (desc, &st) < 0) perror_with_name (s->filename); ! if (s->objfile && s->objfile->obfd) mtime = bfd_get_mtime (s->objfile->obfd); else if (exec_bfd) mtime = bfd_get_mtime (exec_bfd); ------=_20070811135315_11688--