mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 10:13:03 +00:00
* data/glr.c (yyparse): Don't assume that the initial calls
to YYMALLOC succeed; in that case, yyparse incorrectly returned 0. Print a stack-overflow message and fail instead. Initialize the line-number information before creating the stack, so that the stack-overflow message can report line zero safely.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
* data/glr.c (yyparse): Don't assume that the initial calls
|
||||||
|
to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
|
||||||
|
Print a stack-overflow message and fail instead.
|
||||||
|
Initialize the line-number information before creating the stack,
|
||||||
|
so that the stack-overflow message can report line zero safely.
|
||||||
|
|
||||||
2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
|
2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
Fix problems reported by twlevo@xs4all.nl.
|
Fix problems reported by twlevo@xs4all.nl.
|
||||||
|
|||||||
13
data/glr.c
13
data/glr.c
@@ -1967,14 +1967,6 @@ yyrecoverSyntaxError (yyGLRStack* yystack,
|
|||||||
YYDPRINTF ((stderr, "Starting parse\n"));
|
YYDPRINTF ((stderr, "Starting parse\n"));
|
||||||
|
|
||||||
yytoken = YYEMPTY;
|
yytoken = YYEMPTY;
|
||||||
|
|
||||||
if (setjmp (yystack.yyexception_buffer) != 0)
|
|
||||||
goto yyDone;
|
|
||||||
|
|
||||||
if (! yyinitGLRStack (&yystack, YYINITDEPTH))
|
|
||||||
goto yyDone;
|
|
||||||
yystack.yytokenp = &yytoken;
|
|
||||||
|
|
||||||
yylval = yyval_default;
|
yylval = yyval_default;
|
||||||
]b4_location_if([
|
]b4_location_if([
|
||||||
#if YYLTYPE_IS_TRIVIAL
|
#if YYLTYPE_IS_TRIVIAL
|
||||||
@@ -1992,6 +1984,11 @@ m4_popdef([b4_at_dollar])dnl
|
|||||||
/* Line __line__ of glr.c. */
|
/* Line __line__ of glr.c. */
|
||||||
b4_syncline([@oline@], [@ofile@])])dnl
|
b4_syncline([@oline@], [@ofile@])])dnl
|
||||||
[
|
[
|
||||||
|
if (setjmp (yystack.yyexception_buffer) != 0)
|
||||||
|
goto yyDone;
|
||||||
|
if (! yyinitGLRStack (&yystack, YYINITDEPTH))
|
||||||
|
yyStackOverflow (&yystack]b4_lpure_args[);
|
||||||
|
yystack.yytokenp = &yytoken;
|
||||||
yyglrShift (&yystack, 0, 0, 0, yylval, &yylloc]b4_user_args[);
|
yyglrShift (&yystack, 0, 0, 0, yylval, &yylloc]b4_user_args[);
|
||||||
yyposn = 0;
|
yyposn = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user