Re: [PATCH] fast-import: export correctly marks larger than 2^20-1
On Tue, Jul 13, 2010 at 4:51 AM, Raja R Harinath <harinath@hurrynot.org> wrote:
Show 18 quoted lines
> dump_marks_helper() has a bug when dumping marks larger than 2^20-1,
> i.e., when the sparse array has more than two levels. The bug was
> that the 'base' counter was being shifted by 20 bits at level 3, and
> then again by 10 bits at level 2, rather than a total shift of 20 bits
> in this argument to the recursive call:
>
> (base + k) << m->shift
>
> There are two ways to fix this correctly, the elegant:
>
> (base + k) << 10
>
> and the one I chose due to edit distance:
>
> base + (k << m->shift)
>
> Cc: Shawn O. Pearce <spearce@spearce.org>
> Signed-off-by: Raja R Harinath <harinath@hurrynot.org>
Dang, that's a very old bug. This change makes sense, thanks.
Acked-by: Shawn O. Pearce <spearce@spearce.org>
--
Shawn.