This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: No longer accept NULL values in value_bits_valid and value_bits_synthetic_pointer
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Mon, 14 Feb 2011 15:19:39 +0000
>
> On Monday 14 February 2011 14:50:23, Mark Kettenis wrote:
> > > 2011-02-14 Pedro Alves <pedro@codesourcery.com>
> > >
> > > * value.c (value_bits_valid, value_bits_synthetic_pointer):
> > > No longer handle NULL values.
> >
> > Would it be a good idea to add a gdb_assert() here to check for a NULL pointer?
>
> I considered it, but then didn't add it. None of the
> other value_ functions does that before dereferencing
> the value. There aren't many places these functions are
> called, and, I still plan on putting an assertion like
> that in a few more central places, near the roots of
> the val_print & co call chains, which should cover
> this as well.
Fair enough. Diff looks reasonable to me.