aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-08-14 18:26:46 +0000
committerMichael Snyder <msnyder@vmware.com>2007-08-14 18:26:46 +0000
commit348144bad4817b70db0c33f4539e36ef9f9b75e9 (patch)
treea36f03bda1f49ea20099ea541a90a815d1b2efae /gdb/varobj.c
parentb8926edcac8a2f8731e12f7a138f74ab842d7e42 (diff)
downloadfsf-binutils-gdb-348144bad4817b70db0c33f4539e36ef9f9b75e9.zip
fsf-binutils-gdb-348144bad4817b70db0c33f4539e36ef9f9b75e9.tar.gz
fsf-binutils-gdb-348144bad4817b70db0c33f4539e36ef9f9b75e9.tar.bz2
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.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index dbeaff4..be6df5e 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -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);