2007-08-14 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 14 Aug 2007 18:26:46 +0000 (18:26 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 14 Aug 2007 18:26:46 +0000 (18:26 +0000)
* varobj.c (cplus_describe_child): Guard against null.
Use "NULL" instead of "0" to initialize pointers.

gdb/ChangeLog
gdb/varobj.c

index 77c5a0f75582670c7a6cc1daf2b34d18eae6e697..dc4596d41acaed64062dcef25bed504bceb32630 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-14  Michael Snyder  <msnyder@access-company.com>
+
+       * varobj.c (cplus_describe_child): Guard against null.
+       Use "NULL" instead of "0" to initialize pointers.
+
 2007-08-14  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * arm-tdep.c (arm_gdbarch_init): Allow unknown ABI and FPU settings
index dbeaff491a815c15e1270c583343ede7eb8fa06c..be6df5e8388020030ae9235d9ac110cc366b7dac 100644 (file)
@@ -2315,7 +2315,7 @@ static void
 cplus_describe_child (struct varobj *parent, int index,
                      char **cname, struct value **cvalue, struct type **ctype)
 {
-  char *name = 0;
+  char *name = NULL;
   struct value *value;
   struct type *type;
 
@@ -2396,7 +2396,7 @@ cplus_describe_child (struct varobj *parent, int index,
        }
       else
        {
-         char *access = 0;
+         char *access = NULL;
          int children[3];
          cplus_class_num_children (type, children);
 
@@ -2435,7 +2435,8 @@ cplus_describe_child (struct varobj *parent, int index,
              /* error! */
              break;
            }
-         
+
+         gdb_assert (access);
          if (cname)
            *cname = xstrdup (access);