From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17216 invoked by alias); 14 Aug 2007 20:21:15 -0000 Received: (qmail 17106 invoked by uid 22791); 14 Aug 2007 20:21:15 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 14 Aug 2007 20:21:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D27062AA284; Tue, 14 Aug 2007 16:21:07 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6pUf4B8RCZYv; Tue, 14 Aug 2007 16:21:07 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 98DBD2A9941; Tue, 14 Aug 2007 16:21:07 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 20934E7B54; Tue, 14 Aug 2007 13:24:52 -0700 (PDT) Date: Tue, 14 Aug 2007 20:21:00 -0000 From: Joel Brobecker To: Michael Snyder Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] ada-lang.c, null pointer Message-ID: <20070814202452.GG11498@adacore.com> References: <8146.12.7.175.2.1186864158.squirrel@webmail.sonic.net> <25376.12.7.175.2.1186864263.squirrel@webmail.sonic.net> <20070814042242.GA11498@adacore.com> <002101c7de35$aa7e8600$677ba8c0@sonic.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="BI5RvnYi6R4T2M87" Content-Disposition: inline In-Reply-To: <002101c7de35$aa7e8600$677ba8c0@sonic.net> User-Agent: Mutt/1.4.2.2i 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/msg00293.txt.bz2 --BI5RvnYi6R4T2M87 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 299 > Yeah, Joel, that looks fine to me. You want to check it in? Cool! 2007-08-14 Joel Brobecker Michael Snyder * ada-lang.c (field_alignment): Guard against NULL. I have checked this in. Thanks again, Michael. -- Joel --BI5RvnYi6R4T2M87 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ada-lang.c.diff" Content-length: 789 Index: ada-lang.c =================================================================== RCS file: /cvs/src/src/gdb/ada-lang.c,v retrieving revision 1.100 diff -u -p -r1.100 ada-lang.c --- ada-lang.c 6 Aug 2007 20:07:44 -0000 1.100 +++ ada-lang.c 14 Aug 2007 03:45:04 -0000 @@ -6116,9 +6116,17 @@ static unsigned int field_alignment (struct type *type, int f) { const char *name = TYPE_FIELD_NAME (type, f); - int len = (name == NULL) ? 0 : strlen (name); + int len; int align_offset; + /* The field name should never be null, unless the debugging information + is somehow malformed. In this case, we assume the field does not + require any alignment. */ + if (name == NULL) + return 1; + + len = strlen (name); + if (!isdigit (name[len - 1])) return 1; --BI5RvnYi6R4T2M87--