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

svn_fs__dag_get_node question

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-06-08 01:35:10 CEST

Philip Martin <philip@codematters.co.uk> writes:

> These are junk, the addresses are out-of-bounds. I see that
> id_check_ancestor is calling svn_fs__dag_get_node without checking the
> returned error. Is this correct?

There are four calls to svn_fs__dag_get_node in libsvn_fs/tree.c that
do not check the returned error status

static svn_error_t *
id_check_ancestor (int *is_ancestor,
                   svn_fs_t *fs,
                   const svn_fs_id_t *id1,
                   const svn_fs_id_t *id2,
                   trail_t *trail)
{
  dag_node_t *node1, *node2;

  /* Get the nodes. */
  svn_fs__dag_get_node (&node1, fs, id1, trail);
  svn_fs__dag_get_node (&node2, fs, id2, trail);
  
  /* Do the test. If the test fails, we'll just go with "not an
     ancestor" for now. ### better come back and check this out. */
  return svn_fs__dag_is_ancestor (is_ancestor, node1, node2, trail);
}

static svn_error_t *
id_is_parent (int *is_parent,
              svn_fs_t *fs,
              const svn_fs_id_t *id1,
              const svn_fs_id_t *id2,
              trail_t *trail)
{
  dag_node_t *node1, *node2;

  /* Get the nodes. */
  svn_fs__dag_get_node (&node1, fs, id1, trail);
  svn_fs__dag_get_node (&node2, fs, id2, trail);

  return svn_fs__dag_is_parent (is_parent, node1, node2, trail);
}

So the question is what should happen if the calls fail. Should the
two functions id_check_ancestor and id_is_parent also fail? Or should
they succeed but set *is_ancestor and *is_parent false?

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 8 01:35:40 2002

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.