- /* first, find an empty slot to prevent newly hashed entries from
- being slopped into... */
-
- for( q=stab; q< &stab[SYMTSZ]; ++q ){
- if( q->stype == TNULL )goto search;
- }
-
- cerror( "symbol table full");
-
- search:
- p = q;
-
- for(;;){
- if( p->stype == TNULL ) {
- rehash = 0;
- goto next;
- }
- lineno = p->suse;
- if( lineno < 0 ) lineno = - lineno;
- if( p->slevel>lev ){ /* must clobber */
- if( p->stype == UNDEF || ( p->sclass == ULABEL && lev < 2 ) ){
+ /* step 1: remove entries */
+ while( chaintop-1 > lev ){
+ register int type;
+
+ p = schain[--chaintop];
+ schain[chaintop] = 0;
+ for( ; p; p = q ){
+ q = p->snext;
+ type = p->stype;
+ if( p->stype == TNULL || p->slevel <= lev )
+ cerror( "schain botch" );
+ lineno = p->suse < 0 ? -p->suse : p->suse;
+ if( p->stype==UNDEF || ( p->sclass==ULABEL && lev<2 ) ){