mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
* 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:
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2002, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
11
data/push.c
11
data/push.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user