This is the mail archive of the gdb-patches@sourceware.org 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: No longer accept NULL values in value_bits_valid and value_bits_synthetic_pointer


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.

-- 
Pedro Alves


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