It would be great if somebody can come up with a test case for this,
but so far I can't. I think the current code is correct --- albeit
unintentionally. The reason is that rehashing by itself cannot cause a
wrapped-around clump of keys to grow, because when rehashing keys can
only move to higher indexes. In #15077 what happened was that keys
that used to be at some low index ended up at the end of a clump of
keys that straddled the middle of the table, making the clump bigger
than before. But I don't think this can happen for a wrapped-around
set of keys. Hopefully people will check my reasoning here.

Probably still worth making this change though just to be defensive.
Just don't get mad at me for committing the change without a test case
:)


On Wed, Feb 17, 2016 at 1:59 PM, Scott Jones <scott.paul.jo...@gmail.com> wrote:
> I just wanted to warn people that the bug in #15077 is still present, there
> is a small bug in the change #15096 that Jeff merged yesterday.
> Line 536 of dict.jl:
> if index - index0 > maxprobe
> should be
> if ((index - index0) & (newsz - 1)) > maxprobe
> instead, to correctly handle wrapping around the end of the hash table.
>
> Since I am no longer able to submit a PR to fix this, hopefully somebody
> else can shortly.
> Thanks, Scott
>

Reply via email to