Browse Source

* ada-lang.c (field_alignment): Guard against NULL.

gdb_6_7-branch
Joel Brobecker 19 years ago
parent
commit
64a1bf1957
  1. 5
      gdb/ChangeLog
  2. 10
      gdb/ada-lang.c

5
gdb/ChangeLog

@ -1,3 +1,8 @@
2007-08-14 Joel Brobecker <brobecker@adacore.com>
Michael Snyder <msnyder@access-company.com>
* ada-lang.c (field_alignment): Guard against NULL.
2007-08-14 Joel Brobecker <brobecker@adacore.com>
* MAINTAINERS (Global Maintainers): Add self.

10
gdb/ada-lang.c

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

Loading…
Cancel
Save