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

choose_delta_base shift problem

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 25 Apr 2014 10:37:05 +0100

Experimenting with gcc 4.9's -fsantize=undefined I got a warning:

$ svnadmin create repo
$ svn mkdir -mm file://`pwd`/repo/A
../src/subversion/libsvn_fs_fs/transaction.c:1978:14: runtime error: shift exponent -1 is negative

The code is

   1976 /* We also don't want the linear deltification to span more shards
   1977 than deltas would be used in the simple skip-delta schme. */
   1978 if ((1 << (--shards)) <= walk)
   1979 count = noderev->predecessor_count - 1;

Perhaps something like this:

Index: subversion/libsvn_fs_fs/transaction.c
===================================================================
--- subversion/libsvn_fs_fs/transaction.c (revision 1589957)
+++ subversion/libsvn_fs_fs/transaction.c (working copy)
@@ -1975,7 +1975,7 @@ choose_delta_base(representation_t **rep,
 
       /* We also don't want the linear deltification to span more shards
          than deltas would be used in the simple skip-delta schme. */
- if ((1 << (--shards)) <= walk)
+ if (shards > 0 && (1 << (--shards)) <= walk)
         count = noderev->predecessor_count - 1;
     }
 

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2014-04-25 11:37:46 CEST

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.