From: Michael Snyder Date: Tue, 24 Jul 2007 22:49:44 +0000 (+0000) Subject: 2007-07-24 Michael Snyder X-Git-Tag: binutils-2_18-branchpoint~125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=747f3d188953be4a7c52dae9c8c3bc0090657bde;p=platform%2Fupstream%2Fbinutils.git 2007-07-24 Michael Snyder * ax-gdb.c (find_field): Guard against null ptr. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ebe934d..59a3a02 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2007-07-24 Michael Snyder + + * ax-gdb.c (find_field): Guard against null ptr. + 2007-07-24 Ulrich Weigand * regformats/reg-spu.dat: Fix order of npc, id registers. diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 82e0953..adb4b17 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -1172,12 +1172,15 @@ find_field (struct type *type, char *name) { char *this_name = TYPE_FIELD_NAME (type, i); - if (this_name && strcmp (name, this_name) == 0) - return i; + if (this_name) + { + if (strcmp (name, this_name) == 0) + return i; - if (this_name[0] == '\0') - internal_error (__FILE__, __LINE__, - _("find_field: anonymous unions not supported")); + if (this_name[0] == '\0') + internal_error (__FILE__, __LINE__, + _("find_field: anonymous unions not supported")); + } } error (_("Couldn't find member named `%s' in struct/union `%s'"),