summaryrefslogtreecommitdiff
path: root/gdb/values.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-12-11 18:35:38 +0000
committerAndrew Cagney <cagney@redhat.com>2001-12-11 18:35:38 +0000
commit5ae326fa7049c90412645417e00dfed7325dc279 (patch)
tree6de14f81cb0286ef6d4e8a480c4967bfa7938cb4 /gdb/values.c
parent583f192640de9cb90cf171ea6112d3d05855fef4 (diff)
downloadbinutils-gdb-5ae326fa7049c90412645417e00dfed7325dc279.tar.gz
Rearange code to supress -Wuninitialized error.
Diffstat (limited to 'gdb/values.c')
-rw-r--r--gdb/values.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/values.c b/gdb/values.c
index b8407e123fb..cc90caacd7a 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -33,6 +33,7 @@
#include "scm-lang.h"
#include "demangle.h"
#include "doublest.h"
+#include "gdb_assert.h"
/* Prototypes for exported functions. */
@@ -971,14 +972,18 @@ value_fn_field (value_ptr *arg1p, struct fn_field *f, int j, struct type *type,
struct minimal_symbol *msym;
sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
- if (!sym)
+ if (sym != NULL)
{
+ msym = NULL;
+ }
+ else
+ {
+ gdb_assert (sym == NULL);
msym = lookup_minimal_symbol (physname, NULL, NULL);
+ if (msym == NULL)
+ return NULL;
}
- if (!sym && !msym)
- return NULL;
-
v = allocate_value (ftype);
if (sym)
{