# HG changeset patch # User David A. Holland # Date 1370904576 14400 # Node ID bbbf71859a21400364018727709b543b968f67be # Parent d122b4553150e99f31bfeb33e9d5fb40010a65b8 fix stupid bugs diff -r d122b4553150 -r bbbf71859a21 macro.c --- a/macro.c Mon Jun 10 18:40:26 2013 -0400 +++ b/macro.c Mon Jun 10 18:49:36 2013 -0400 @@ -355,12 +355,16 @@ assert(hashmask == numbuckets - 1); newmask = (hashmask << 1) | 1U; - tossbit = newmask && ~hashmask; + tossbit = newmask & ~hashmask; hashmask = newmask; for (i=0; i<numbuckets; i++) { newbucket = NULL; oldbucket = macroarrayarray_get(¯os, i); + if (oldbucket == NULL) { + macroarrayarray_set(¯os, numbuckets + i, NULL); + continue; + } oldnum = macroarray_num(oldbucket); for (j=0; j<oldnum; j++) { m = macroarray_get(oldbucket, j); @@ -374,8 +378,11 @@ } for (j=k=0; j<oldnum; j++) { m = macroarray_get(oldbucket, j); - if (m != NULL && k < j) { - macroarray_set(oldbucket, k++, m); + if (m != NULL) { + if (k < j) { + macroarray_set(oldbucket, k, m); + } + k++; } } macroarray_setsize(oldbucket, k);