🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs
Article #207

lex bug (v7, 2.8, 4.1, maybe others)

#207
From: stewart
Date: Wed, 23 May 1984 17:08
51 lines
2124 bytes
Lex versions:  version 7, Berkeley 2.8 and 4.1 (probably
won't be visible on 32-bit machines, however).

This bug is not in lex itself, but in the boilerplate
lex pulls out of its library to make lex.yy.c.
The original cast two pointers to type int before
comparing them.  Needless to say, on our 16-bit int pdp11
this causes errors when the addresses creep past 0x8000.
I don't know why the casts were inserted, the pointers were
the same type.

John Stewart

*** /usr/lib/lex/ncform	Wed May 23 10:13:30 1984
--- /usr/lib/lex/ncform.old	Thu Aug 11 23:51:26 1983
***************
*** 54,60
  				}
  # endif
  			yyr = yyt;
! 			if (yyt > yycrank){
  				yyt = yyr + yych;
  				if (yyt <= yytop && yyt->verify+yysvec == yystate){
  					if(yyt->advance+yysvec == YYLERR)	/* error transitions */

--- 54,60 -----
  				}
  # endif
  			yyr = yyt;
! 			if ( (int)yyt > (int)yycrank){
  				yyt = yyr + yych;
  				if (yyt <= yytop && yyt->verify+yysvec == yystate){
  					if(yyt->advance+yysvec == YYLERR)	/* error transitions */
***************
*** 64,70
  					}
  				}
  # ifdef YYOPTIM
! 			else if(yyt < yycrank) {		/* r < yycrank */
  				yyt = yyr = yycrank+(yycrank-yyt);
  # ifdef LEXDEBUG
  				if(debug)fprintf(yyout,"compressed state\n");

--- 64,70 -----
  					}
  				}
  # ifdef YYOPTIM
! 			else if((int)yyt < (int)yycrank) {		/* r < yycrank */
  				yyt = yyr = yycrank+(yycrank-yyt);
  # ifdef LEXDEBUG
  				if(debug)fprintf(yyout,"compressed state\n");
Technical Details
Message-ID: <1374@seismo.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!hogpc!houti!ariel!vax135!floyd!cmcl2!seismo!stewart

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 beta 4/10/84; site seismo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!hogpc!houti!ariel!vax135!floyd!cmcl2!seismo!stewart
From: stewart@seismo.UUCP
Newsgroups: net.bugs,net.unix-wizards
Subject: lex bug (v7, 2.8, 4.1, maybe others)
Message-ID: <1374@seismo.UUCP>
Date: Wed, 23-May-84 13:08:06 EDT
Article-I.D.: seismo.1374
Posted: Wed May 23 13:08:06 1984
Date-Received: Sat, 26-May-84 13:01:18 EDT
Distribution: net
Organization: Center for Seismic Studies, Arlington, VA
Lines: 51