2007-07-24 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 24 Jul 2007 22:49:44 +0000 (22:49 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 24 Jul 2007 22:49:44 +0000 (22:49 +0000)
* ax-gdb.c (find_field): Guard against null ptr.

gdb/ChangeLog
gdb/ax-gdb.c

index ebe934d6dd3910ad0f42ad2a6ed1cbbc1b50c3a1..59a3a022de3b1e6e234e00f78ad27084bcb32eb1 100644 (file)
@@ -1,3 +1,7 @@
+2007-07-24  Michael Snyder  <msnyder@access-company.com>
+
+       * ax-gdb.c (find_field): Guard against null ptr.
+
 2007-07-24  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * regformats/reg-spu.dat: Fix order of npc, id registers.
index 82e095367aabc64f9996f8120cec32cd8265e65c..adb4b17cc3a4a8f5478b6d7a432783ccb8ceeb3b 100644 (file)
@@ -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'"),