Greg Stein <gstein@lyra.org> writes:
> On Sat, Jun 08, 2002 at 12:35:10AM +0100, Philip Martin wrote:
> >...
> > There are four calls to svn_fs__dag_get_node in libsvn_fs/tree.c that
> > do not check the returned error status
> >...
> > 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?
>
> Failure.
>
> If you ask for a specific ID, and it is /not/ present, then BOOM!
How about this
* svn/subversion/libsvn_fs/tree.c
(id_check_ancestor, id_is_parent): Check for errors when getting nodes.
Index: ../svn/subversion/libsvn_fs/tree.c
===================================================================
--- ../svn/subversion/libsvn_fs/tree.c
+++ ../svn/subversion/libsvn_fs/tree.c Sat Jun 8 00:38:27 2002
@@ -1214,8 +1214,8 @@
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);
+ SVN_ERR (svn_fs__dag_get_node (&node1, fs, id1, trail));
+ SVN_ERR (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. */
@@ -1234,8 +1234,8 @@
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);
+ SVN_ERR (svn_fs__dag_get_node (&node1, fs, id1, trail));
+ SVN_ERR (svn_fs__dag_get_node (&node2, fs, id2, trail));
return svn_fs__dag_is_parent (is_parent, node1, node2, trail);
}
--
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 02:13:11 2002