From 5ae326fa7049c90412645417e00dfed7325dc279 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 11 Dec 2001 18:35:38 +0000 Subject: [PATCH] Rearange code to supress -Wuninitialized error. --- gdb/ChangeLog | 5 +++++ gdb/values.c | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6dc2b770052..7a25a0dfc89 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2001-12-11 Andrew Cagney + + * values.c: Include "gdb_assert.h". + (value_fn_field): Rearange to avoid -Wuninitialized warning. + 2001-12-10 Fred Fish * values.c (value_fn_field): Add physname variable. Use a minimal 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) { -- 2.30.2