diff options
author | Michael Snyder <msnyder@vmware.com> | 2007-07-24 22:49:44 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2007-07-24 22:49:44 +0000 |
commit | 747f3d188953be4a7c52dae9c8c3bc0090657bde (patch) | |
tree | 60439466463d3e5ae33fbfadad92985f8189d37a /gdb/ax-gdb.c | |
parent | 6baf37728072dc4d99841862a242f25545723c11 (diff) | |
download | gdb-747f3d188953be4a7c52dae9c8c3bc0090657bde.zip gdb-747f3d188953be4a7c52dae9c8c3bc0090657bde.tar.gz gdb-747f3d188953be4a7c52dae9c8c3bc0090657bde.tar.bz2 |
2007-07-24 Michael Snyder <msnyder@access-company.com>
* ax-gdb.c (find_field): Guard against null ptr.
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r-- | gdb/ax-gdb.c | 13 |
1 files changed, 8 insertions, 5 deletions
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'"), |