Author: chromatic
Date: Wed Dec 17 14:26:07 2008
New Revision: 34051
Modified:
trunk/src/pmc/orderedhash.pmc
Log:
[PMC] Fixed OrderedHash PMC's clone() vtable entry not to walk off the end of
the available hash buckets. Much of this PMC's code should move into
src/hash.c.
Modified: trunk/src/pmc/orderedhash.pmc
==============================================================================
--- trunk/src/pmc/orderedhash.pmc (original)
+++ trunk/src/pmc/orderedhash.pmc Wed Dec 17 14:26:07 2008
@@ -583,7 +583,8 @@
Hash * const h_dest = (Hash *)PMC_struct_val(dest);
UINTVAL i;
- for (i = 0; i <= hash->mask; i++) {
+ /* see N_BUCKETS in src/hash.c; 3/4 of the available bucket slots */
+ for (i = 0; i <= ((hash->mask - 1) * 3 / 4); i++) {
HashBucket * const b = hash->bs + i;
void * const key = b->key;