[Unison-hackers] [unison-svn] r498 - trunk/src
vouillon at seas.upenn.edu
vouillon at seas.upenn.edu
Thu May 24 06:22:15 EDT 2012
Author: vouillon
Date: 2012-05-24 06:22:14 -0400 (Thu, 24 May 2012)
New Revision: 498
Modified:
trunk/src/RECENTNEWS
trunk/src/mkProjectInfo.ml
trunk/src/transfer.ml
Log:
* Added some more debugging code in transfer.ml
Modified: trunk/src/RECENTNEWS
===================================================================
--- trunk/src/RECENTNEWS 2012-05-23 18:55:29 UTC (rev 497)
+++ trunk/src/RECENTNEWS 2012-05-24 10:22:14 UTC (rev 498)
@@ -1,3 +1,7 @@
+CHANGES FROM VERSION 2.45.9
+
+* Added some more debugging code in transfer.ml
+-------------------------------
CHANGES FROM VERSION 2.45.7
* Small fix to the way fsmonitor.py gets invoked when using the file
Modified: trunk/src/mkProjectInfo.ml
===================================================================
--- trunk/src/mkProjectInfo.ml 2012-05-23 18:55:29 UTC (rev 497)
+++ trunk/src/mkProjectInfo.ml 2012-05-24 10:22:14 UTC (rev 498)
@@ -71,3 +71,5 @@
+
+
Modified: trunk/src/transfer.ml
===================================================================
--- trunk/src/transfer.ml 2012-05-23 18:55:29 UTC (rev 497)
+++ trunk/src/transfer.ml 2012-05-24 10:22:14 UTC (rev 498)
@@ -521,7 +521,14 @@
(* Given a key, retrieve the corresponding entry in the table *)
let findEntry hashTable hashTableLength checksum :
(int * Checksum.t) list =
- Array.unsafe_get hashTable ((hash checksum) land (hashTableLength - 1))
+ let i = (hash checksum) land (hashTableLength - 1) in
+ (*FIX: temporary debugging code... *)
+ if i < 0 || i >= Array.length hashTable then begin
+ Format.eprintf "index:%d checksum:%d len:%d/%d at ."
+ i checksum hashTableLength (Array.length hashTable);
+ assert false
+ end;
+ hashTable.(i)
let sigFilter hashTableLength signatures =
let len = hashTableLength lsl 2 in
@@ -664,13 +671,20 @@
let rec fingerprintMatchRec checksums pos fp i =
let i = i - 1 in
i < 0 ||
- (String.unsafe_get fp i = checksums.{pos + i} &&
+ (fp.[i] = checksums.{pos + i} &&
fingerprintMatchRec checksums pos fp i)
in
let fingerprintMatch k fp =
let pos = k * sigs.checksumSize in
- assert
- (pos + sigs.checksumSize <= Bigarray.Array1.dim sigs.strongChecksum);
+ (*FIX: temporary debugging code... *)
+ if
+ pos + sigs.checksumSize > Bigarray.Array1.dim sigs.strongChecksum
+ then begin
+ Format.eprintf "k:%d/%d pos:%d csSize:%d dim:%d at ."
+ k sigs.blockCount pos sigs.checksumSize
+ (Bigarray.Array1.dim sigs.strongChecksum);
+ assert false
+ end;
fingerprintMatchRec sigs.strongChecksum pos fp sigs.checksumSize
in
More information about the Unison-hackers
mailing list