Fixed a pointer test again -- but, it's better than in pull request #391.

This time, the expression compares the pointer directly, instead of comparing the pointer's target.  The new expression avoids an array underrun.
This commit is contained in:
Greg King 2017-03-11 15:11:15 -05:00
parent 23d4534f94
commit 73261ea48f
1 changed files with 3 additions and 3 deletions

View File

@ -562,13 +562,13 @@ yylook()
}
# ifdef LEXDEBUG
if (*(lsp-1) < yysvec + 1)
if (lsp == yylstate)
{
fprintf(yyout,"yylook: stopped (end)\n");
}
else
{
fprintf(yyout,"yylook: stopped at %d with\n",*(lsp-1)-yysvec-1);
fprintf(yyout,"yylook: stopped at %d with:\n",*(lsp-1)-(yysvec+1));
}
# endif
while (lsp-- > yylstate)
@ -594,7 +594,7 @@ yylook()
yyleng = yylastch-yytext+1;
yytext[yyleng] = 0;
# ifdef LEXDEBUG
fprintf(yyout,"\nyylook: match action %d\n",*yyfnd);
fprintf(yyout,"yylook: match action %d\n",*yyfnd);
fprintf(yyout,"yylook: done loops: %d\n",testbreak);
# endif
return(*yyfnd++);