Rearange code to supress -Wuninitialized error.

This commit is contained in:
Andrew Cagney 2001-12-11 18:35:38 +00:00
parent 583f192640
commit 5ae326fa70
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2001-12-11 Andrew Cagney <ac131313@redhat.com>
* values.c: Include "gdb_assert.h".
(value_fn_field): Rearange to avoid -Wuninitialized warning.
2001-12-10 Fred Fish <fnf@redhat.com>
* values.c (value_fn_field): Add physname variable. Use a minimal

View File

@ -33,6 +33,7 @@
#include "scm-lang.h"
#include "demangle.h"
#include "doublest.h"
#include "gdb_assert.h"
/* Prototypes for exported functions. */
@ -971,13 +972,17 @@ 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 = lookup_minimal_symbol (physname, NULL, 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)