This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch/ob]


On Tue, Dec 11, 2001 at 10:18:05AM -0800, Andrew Cagney wrote:
> Just FYI,
> 
> I've checked the attached in as, er, obvious.  It fixes a
> -Wuninitialized warning.

I agree with the "er, obvious".

Would there be anything wrong with:

> *************** value_fn_field (value_ptr *arg1p, struct
> *** 971,983 ****
>     struct minimal_symbol *msym;

adding = NULL to the line above?

>   
>     sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
> !   if (!sym)
>       {
>         msym = lookup_minimal_symbol (physname, NULL, NULL);
>       }
> - 
> -   if (!sym && !msym)
> -     return NULL;
>   
>     v = allocate_value (ftype);
>     if (sym)
> --- 972,988 ----
>     struct minimal_symbol *msym;
>   
>     sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
> !   if (sym != NULL)
>       {
> +       msym = NULL;
> +     }
> +   else
> +     {
> +       gdb_assert (sym == NULL);

This assert in particular bugs me.  Adding asserts that the compiler
can obviously eliminate, since sym isn't volatile...


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]