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: [patch] Cleanup init_raw_breakpoint


On Friday 11 November 2011 01:56:24, Yao Qi wrote:
> On 11/11/2011 02:45 AM, Pedro Alves wrote:
> > ...
> >> > +
> >> > +  if (b->loc == NULL)
> >> > +    b->loc = loc;
> > I don't understand the need for the explicit NULL check.
> > 
> > When b->loc is NULL, this:
> > 
> >      for (tmp = &(b->loc); *tmp != NULL; tmp = &((*tmp)->next))
> >       ;
> >      *tmp = loc;
> > 
> > is the same as `b->loc = loc'?
> > 
> 
> Hmmm, right.  Original code is able to handle NULL.  How about this new
> patch?

Looks good.  Ok.

-- 
Pedro Alves


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