Suppress corrupt error output from dbStatic parser

The yyerror() routine gets called twice in some cases.
Don't print the yytext or input file location the second
time through -- yytext has already been freed, and the
user doesn't need to see the location twice.

Fixes lp:1422803
This commit is contained in:
Andrew Johnson
2015-02-19 17:33:27 -06:00
parent 9813fa6474
commit e822d8d8c4

View File

@@ -266,12 +266,14 @@ alias: tokenALIAS '(' tokenSTRING ',' tokenSTRING ')'
static int yyerror(char *str)
{
if (str)
epicsPrintf("Error: %s\n ", str);
epicsPrintf("Error: %s\n", str);
else
epicsPrintf("Error");
epicsPrintf(" at or before \"%s\"", yytext);
dbIncludePrint();
yyFailed = TRUE;
if (!yyFailed) { /* Only print this stuff once */
epicsPrintf(" at or before \"%s\"", yytext);
dbIncludePrint();
yyFailed = TRUE;
}
return(0);
}
static long pvt_yy_parse(void)