Re: [PATCH] fix diff-delta bad memory access

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nicolas Pitre <nico@...>
Cc: Junio C Hamano <junkio@...>, <git@...>, Randal L. Schwartz <merlyn@...>, Alex Riesen <raa.lkml@...>
Date: Wednesday, May 10, 2006 - 3:01 pm

Btw, Nico, that rabin hash code is _extremely_ confusing.

The hash entry pointers point to "data + RABIN_WINDOW", and then to make 
things even _more_ confusing, the hash calculation code is actually offset 
by one, so it will have computed the hash with

	val = ((val << 8) | data[i]) ^ T[val >> RABIN_SHIFT];

where "i" goes from _1_ to RABIN_WINDOW instead of 0..WINDOW-1.

So, if I read that correctly, the "entry->ptr" actually points not to the 
beginning of the data that was hashed, or even the end, but literally to 
the last byte of the data that was hashed in that window.

Isn't that just _really_ confusing?

Or is there some sense to this?

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] fix diff-delta bad memory access, Nicolas Pitre, (Wed May 10, 12:26 pm)
Re: [PATCH] fix diff-delta bad memory access, Linus Torvalds, (Wed May 10, 1:00 pm)
Re: [PATCH] fix diff-delta bad memory access, Nicolas Pitre, (Wed May 10, 1:27 pm)
Re: [PATCH] fix diff-delta bad memory access, Linus Torvalds, (Wed May 10, 3:01 pm)
Re: [PATCH] fix diff-delta bad memory access, Nicolas Pitre, (Wed May 10, 3:43 pm)
Re: [PATCH] fix diff-delta bad memory access, Nicolas Pitre, (Wed May 10, 3:57 pm)
Re: [PATCH] fix diff-delta bad memory access, Linus Torvalds, (Wed May 10, 1:18 pm)