projects
/
external
/
binutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
692263b
)
* completer.c (add_struct_fields): Check type_name against NULL
author
Tom Tromey
<tromey@redhat.com>
Tue, 3 Feb 2009 19:20:02 +0000
(19:20 +0000)
committer
Tom Tromey
<tromey@redhat.com>
Tue, 3 Feb 2009 19:20:02 +0000
(19:20 +0000)
before use.
gdb/ChangeLog
patch
|
blob
|
history
gdb/completer.c
patch
|
blob
|
history
diff --git
a/gdb/ChangeLog
b/gdb/ChangeLog
index
db38fec
..
0f57551
100644
(file)
--- a/
gdb/ChangeLog
+++ b/
gdb/ChangeLog
@@
-1,3
+1,8
@@
+2009-02-03 Tom Tromey <tromey@redhat.com>
+
+ * completer.c (add_struct_fields): Check type_name against NULL
+ before use.
+
2009-02-03 Joel Brobecker <brobecker@adacore.com>
* MAINTAINERS: Update Elena's email address.
2009-02-03 Joel Brobecker <brobecker@adacore.com>
* MAINTAINERS: Update Elena's email address.
diff --git
a/gdb/completer.c
b/gdb/completer.c
index
5d7225f
..
298cdd0
100644
(file)
--- a/
gdb/completer.c
+++ b/
gdb/completer.c
@@
-371,6
+371,7
@@
add_struct_fields (struct type *type, int *nextp, char **output,
char *fieldname, int namelen)
{
int i;
char *fieldname, int namelen)
{
int i;
+ int computed_type_name = 0;
char *type_name = NULL;
CHECK_TYPEDEF (type);
char *type_name = NULL;
CHECK_TYPEDEF (type);
@@
-392,10
+393,13
@@
add_struct_fields (struct type *type, int *nextp, char **output,
char *name = TYPE_FN_FIELDLIST_NAME (type, i);
if (name && ! strncmp (name, fieldname, namelen))
{
char *name = TYPE_FN_FIELDLIST_NAME (type, i);
if (name && ! strncmp (name, fieldname, namelen))
{
- if (!type_name)
- type_name = type_name_no_tag (type);
+ if (!computed_type_name)
+ {
+ type_name = type_name_no_tag (type);
+ computed_type_name = 1;
+ }
/* Omit constructors from the completion list. */
/* Omit constructors from the completion list. */
- if (strcmp (type_name, name))
+ if (
type_name &&
strcmp (type_name, name))
{
output[*nextp] = xstrdup (name);
++*nextp;
{
output[*nextp] = xstrdup (name);
++*nextp;