#if X=3 caused infinite loop

This commit is contained in:
eck 1990-07-25 10:20:44 +00:00
parent 7ef2d1bc37
commit 2807862aba

View file

@ -53,7 +53,6 @@ GetToken(ptok)
again: /* rescan the input after an error or replacement */ again: /* rescan the input after an error or replacement */
LoadChar(c); LoadChar(c);
go_on:
if ((c & 0200) && c != EOI) if ((c & 0200) && c != EOI)
fatal("non-ascii '\\%03o' read", c & 0377); fatal("non-ascii '\\%03o' read", c & 0377);
switch (class(c)) { /* detect character class */ switch (class(c)) { /* detect character class */
@ -118,13 +117,11 @@ go_on:
PushBack(); PushBack();
return ptok->tk_symb = c; return ptok->tk_symb = c;
case '=': case '=':
if (nch == '=') if (nch != '=') {
PushBack();
error("missing =");
}
return ptok->tk_symb = EQUAL; return ptok->tk_symb = EQUAL;
/* The following piece of code tries to recognise
old-fashioned assignment operators `=op'
*/
error("illegal character");
goto go_on;
case '>': case '>':
if (nch == '=') if (nch == '=')
return ptok->tk_symb = GREATEREQ; return ptok->tk_symb = GREATEREQ;