compiler error: schain botch

Chris Torek chris at mimsy.UUCP
Sun Oct 1 15:57:13 AEST 1989


This is an old bug.  Here is the recommended fix.

(Incidentally, this bug usually only surfaces when a function contains a
number of `goto' statements.  Fuel for comp.lang.c.noise.about.goto :-) )

------- pftn.c -------
***************
*** 1922,1926 ****
  	p = clist;
  	while( p ){
! 		register struct symtab *r, *next;
  
  		q = p;
--- 1926,1930 ----
  	p = clist;
  	while( p ){
! 		register struct symtab *next, **t, *r;
  
  		q = p;
***************
*** 1930,1933 ****
--- 1934,1945 ----
  			if( q == p || q->stype == TNULL )break;
  			if( (r = relook(q)) != q ) {
+ 				/* move q in schain list */
+ 				t = &schain[q->slevel];
+ 				while( *t && *t != q )
+ 					t = &(*t)->snext;
+ 				if( *t )
+ 					*t = r;
+ 				else
+ 					cerror("schain botch 2");
  				*r = *q;
  				q->stype = TNULL;
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list