Re: [PATCH v2] stash: pass pathspec as pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/13, Johannes Schindelin wrote:
> Hi Thomas,
> 
> On Tue, 12 Mar 2019, Thomas Gummerer wrote:
> 
> > On 03/12, Johannes Schindelin wrote:
> > > However, we would not have needed to move the initialization of
> > > `rev.prune_data`, I don't think, because `init_revision()` zeros the
> > > entire struct, including `prune_data`, which would have made
> > > `clear_pathspec()` safe to call, too.
> > 
> > 'clear_pathspec()' doesn't actually check whether the parameter passed
> > to it is NULL or not before dereferencing it.
> 
> In this case, it does not need to check for NULL, as `&rev.prune_data`
> will always be non-NULL: `rev`'s `prune_data` field is of type `struct
> patchspec`, i.e. *not* a pointer (in which case the type would be `struct
> pathspec *`). See for yourself:
> 
> 	https://github.com/git/git/blob/v2.21.0/revision.h#L91

Doh, you're right of course, I totally missed that.  Thanks for the
pointer, and sorry for the noise!



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux