fixed an obscure bug in the hash function: sometimes the globstep variable
authorceriel <none@none>
Wed, 11 Nov 1987 15:05:41 +0000 (15:05 +0000)
committerceriel <none@none>
Wed, 11 Nov 1987 15:05:41 +0000 (15:05 +0000)
had a value equal to size! Also, sizes of tables must be prime

util/ass/asprint.p
util/ass/ass30.c
util/ass/ass70.c
util/ass/assda.c

index 9f9c409..f71e02b 100644 (file)
@@ -80,6 +80,7 @@ procedure getit;  { start the ball rolling }
 var cset:set of char;
     f:ifset;
     insno:byte;
+    iclass: insclass;
     nops:integer;
     opcode:byte;
     i,j,n:integer;
index 10c52d0..2535802 100644 (file)
@@ -211,10 +211,13 @@ int i_flag,flag,number ; cons_t val ; {
                if ( val<0 ) val = -1-val ;
                return val>=0 && val<number*256 ;
        case OP16 :
+               /* Commented out for the time being. This must be in
+                  ip_spec.t ...
                if ( i_flag==PAR_G ) {
                        return val>=0 &&
                               val<=maxadr && val <= 65535L;
                }
+               */
                return val>= -32768 && val<=32767 ;
        case OP32 :
                return TRUE ;
index 7181418..4a6547b 100644 (file)
@@ -35,7 +35,7 @@ static int glohash(aname,size) char *aname; {
        for(sum=i=0,p=aname;*p;i += 3)
                sum += (*p++)<<(i&07);
        sum &= 077777;
-       globstep = (sum / size) + 7;
+       globstep = (sum / size) % (size - 7) + 7;
        return(sum % size);
 }
 
index 56ef5ce..0712aec 100644 (file)
@@ -132,6 +132,6 @@ size_t  sizes[NDEFAULT] = {
     { 151,   29,   31,   73,  130 },
     { 307,  127,  151,  401,  460 },
     { 601,  251,  151,  401,  600 },
-    {2000, 2000, 2000, 2000, 2000 }
+    {1601, 1601, 1601, 1601, 2000 }
 };
 size_t  *oursize        =  &sizes[1] ;  /* point to selected sizes */