[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] fix core and make tests pass

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-01-07 18:50:55 CET

Ben Collins-Sussman <sussman@collab.net> writes:

> > If we choose to initialise to null, which looks like a hack to me, it
> > should be done in libsvn_client/commit.c:send_to_repos. Something
> > like
> >
> > if (committed_date)
> > *committed_date = NULL;
>
> I'm not following you here. The command-line client creates two
> uninitialzed pointers. It passes the addresses of these pointers all
> the way down through libsvn_client and into the RA layer. The RA
> layer allocates memory and sets the pointers.
>
> So what's wrong if the original pointers start out as NULL? When we
> commit to XML, no RA layer will ever change them, and thus the current
> code at the end of libsvn_client's send_to_repos() will avoid trying
> to dup their values.
>
> Please explain the issue, I'm not sure I understand the problem.
> Otherwise, I'll just go ahead and commit the NULL initializations.

The client creates two unitialised pointers, and passes the address of
these pointers into a function that will set the pointers. Sometimes
the function fails to do that and the pointers remain unitialised. If
you initialise them before passing them in you fix the problem here,
but if the function ever gets called anywhere else you will have to
remember to initialise them there as well. If you initialise them
inside the function it only needs to be done in one place.

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:55 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.