--- /usr/lib/bison.simple Thu Feb 3 12:33:38 2000 +++ bison.simple Mon Jun 25 20:45:08 2001 @@ -130,6 +130,10 @@ #endif /* not YYLSP_NEEDED */ #endif +#ifdef YYFREE +void YYFREE (YYSTYPE); +#endif + /* If nonreentrant, generate the variables here */ #ifndef YYPURE @@ -500,6 +504,9 @@ yychar = YYEMPTY; *++yyvsp = yylval; +#ifdef YYFREE + yylval = NULL; +#endif #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif @@ -594,6 +601,10 @@ yyerrlab: /* here on detecting error */ +#ifdef YYFREE + if (yylval) YYFREE (yylval); +#endif + if (! yyerrstatus) /* If not already recovering from an error, report this error. */ { @@ -681,7 +692,13 @@ yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyssp == yyss) YYABORT; + +#ifdef YYFREE + YYFREE(*yyvsp--); +#else yyvsp--; +#endif + yystate = *--yyssp; #ifdef YYLSP_NEEDED yylsp--; @@ -728,6 +745,9 @@ #endif *++yyvsp = yylval; +#ifdef YYFREE + yylval = NULL; +#endif #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif