From: Joel Brobecker <brobecker@adacore.com>
To: Michael Snyder <msnyder@sonic.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] ada-lang.c, null pointer
Date: Tue, 14 Aug 2007 20:21:00 -0000 [thread overview]
Message-ID: <20070814202452.GG11498@adacore.com> (raw)
In-Reply-To: <002101c7de35$aa7e8600$677ba8c0@sonic.net>
[-- Attachment #1: Type: text/plain, Size: 299 bytes --]
> Yeah, Joel, that looks fine to me. You want to check it in?
Cool!
2007-08-14 Joel Brobecker <brobecker@adacore.com>
Michael Snyder <msnyder@access-company.com>
* ada-lang.c (field_alignment): Guard against NULL.
I have checked this in.
Thanks again, Michael.
--
Joel
[-- Attachment #2: ada-lang.c.diff --]
[-- Type: text/plain, Size: 789 bytes --]
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;
prev parent reply other threads:[~2007-08-14 20:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-11 20:29 msnyder
2007-08-11 20:31 ` msnyder
2007-08-14 4:19 ` Joel Brobecker
2007-08-14 5:49 ` Michael Snyder
2007-08-14 20:21 ` Joel Brobecker [this message]
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=20070814202452.GG11498@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@sonic.net \
/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