* data/Makefile.am: Update copyright date.

* data/push.c (yypull_parse): Report memory exhaustion and return 2 if
yypstate_new returns NULL.
(yypstate_new): Return NULL if malloc does.
* src/reader.c (packgram): Move translation of rule actions from the
beginning of packgram to...
(check_and_convert_grammar): ... here right before packgram is invoked
so it's easier to write more complete comments, and remove redundant
code.
This commit is contained in:
Joel E. Denny
2007-02-11 07:34:26 +00:00
parent e785ccf715
commit 574add857a
4 changed files with 37 additions and 16 deletions

View File

@@ -1091,7 +1091,14 @@ b4_push_if(
]b4_locations_if([[ YYLTYPE yylloc;
]])])[
if (yyps == 0)
yyps_local = yypstate_new ();
{
yyps_local = yypstate_new ();
if (!yyps_local)
{
yyerror (]b4_yyerror_args[YY_("memory exhausted"));
return 2;
}
}
else
yyps_local = yyps;
do {
@@ -1108,6 +1115,8 @@ b4_push_if(
]b4_c_function_def([[yypstate_new]], [[yypstate *]])[
{
yypstate *yyps = (yypstate *) malloc (sizeof *yyps);
if (!yyps)
return 0;
yyps->yynew = 1;
return yyps;
}