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

[PATCH] Re: same ol' repository bug

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-10-26 17:40:10 CET

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

> I think dag_node_cache_get needs to accept a pool parameter and call
> svn_fs__dag_dup() and so return a pointer to a node with a defined
> lifetime.

This satisfies valgrind and allows me to dump the repository without
triggering a non-existent node error.

Index: subversion/libsvn_fs/tree.c
===================================================================
--- subversion/libsvn_fs/tree.c (revision 7519)
+++ subversion/libsvn_fs/tree.c (working copy)
@@ -209,7 +209,8 @@
    isn't cached. */
 static dag_node_t *
 dag_node_cache_get (svn_fs_root_t *root,
- const char *path)
+ const char *path,
+ apr_pool_t *pool)
 {
   struct dag_node_cache_t *cache_item;
 
@@ -223,7 +224,7 @@
   /* Look in the cache for our desired item. */
   cache_item = apr_hash_get (root->node_cache, path, APR_HASH_KEY_STRING);
   if (cache_item)
- return cache_item->node;
+ return svn_fs__dag_dup (cache_item->node, pool);
 
   return NULL;
 }
@@ -865,7 +866,7 @@
           /* If we found a directory entry, follow it. First, we
              check our node cache, and, failing that, we hit the DAG
              layer. */
- cached_node = dag_node_cache_get (root, path_so_far);
+ cached_node = dag_node_cache_get (root, path_so_far, pool);
           if (cached_node)
             child = cached_node;
           else
@@ -1030,7 +1031,7 @@
   path = svn_fs__canonicalize_abspath (path, trail->pool);
 
   /* If ROOT is a revision root, we'll look for the DAG in our cache. */
- node = dag_node_cache_get (root, path);
+ node = dag_node_cache_get (root, path, trail->pool);
   if (! node)
     {
       /* Call open_path with no flags, as we want this to return an error

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Oct 26 17:41:07 2003

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.