mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
* src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
defined only if yyoverflow is defined, to avoid `warning: unused variable `yyvs1''. Reported by The Test Suite.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2001-11-14 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
|
||||||
|
defined only if yyoverflow is defined, to avoid `warning: unused
|
||||||
|
variable `yyvs1''.
|
||||||
|
Reported by The Test Suite.
|
||||||
|
|
||||||
2001-11-14 Akim Demaille <akim@epita.fr>
|
2001-11-14 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/print.c: Include reduce.h.
|
* src/print.c: Include reduce.h.
|
||||||
|
|||||||
@@ -545,40 +545,38 @@ yyparse (YYPARSE_PARAM_ARG)
|
|||||||
|
|
||||||
if (yyssp >= yyss + yystacksize - 1)
|
if (yyssp >= yyss + yystacksize - 1)
|
||||||
{
|
{
|
||||||
/* Give user a chance to reallocate the stack. Use copies of
|
|
||||||
these so that the &'s don't force the real ones into memory.
|
|
||||||
*/
|
|
||||||
YYSTYPE *yyvs1 = yyvs;
|
|
||||||
short *yyss1 = yyss;
|
|
||||||
#if YYLSP_NEEDED
|
|
||||||
YYLTYPE *yyls1 = yyls;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Get the current used size of the three stacks, in elements. */
|
/* Get the current used size of the three stacks, in elements. */
|
||||||
int size = yyssp - yyss + 1;
|
int size = yyssp - yyss + 1;
|
||||||
|
|
||||||
#ifdef yyoverflow
|
#ifdef yyoverflow
|
||||||
/* Each stack pointer address is followed by the size of the
|
{
|
||||||
data in use in that stack, in bytes. */
|
/* Give user a chance to reallocate the stack. Use copies of
|
||||||
# if YYLSP_NEEDED
|
these so that the &'s don't force the real ones into
|
||||||
/* This used to be a conditional around just the two extra args,
|
memory. */
|
||||||
but that might be undefined if yyoverflow is a macro. */
|
YYSTYPE *yyvs1 = yyvs;
|
||||||
yyoverflow ("parser stack overflow",
|
short *yyss1 = yyss;
|
||||||
&yyss1, size * sizeof (*yyssp),
|
|
||||||
&yyvs1, size * sizeof (*yyvsp),
|
|
||||||
&yyls1, size * sizeof (*yylsp),
|
|
||||||
&yystacksize);
|
|
||||||
# else
|
|
||||||
yyoverflow ("parser stack overflow",
|
|
||||||
&yyss1, size * sizeof (*yyssp),
|
|
||||||
&yyvs1, size * sizeof (*yyvsp),
|
|
||||||
&yystacksize);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
yyss = yyss1; yyvs = yyvs1;
|
/* Each stack pointer address is followed by the size of the
|
||||||
|
data in use in that stack, in bytes. */
|
||||||
# if YYLSP_NEEDED
|
# if YYLSP_NEEDED
|
||||||
yyls = yyls1;
|
YYLTYPE *yyls1 = yyls;
|
||||||
|
/* This used to be a conditional around just the two extra args,
|
||||||
|
but that might be undefined if yyoverflow is a macro. */
|
||||||
|
yyoverflow ("parser stack overflow",
|
||||||
|
&yyss1, size * sizeof (*yyssp),
|
||||||
|
&yyvs1, size * sizeof (*yyvsp),
|
||||||
|
&yyls1, size * sizeof (*yylsp),
|
||||||
|
&yystacksize);
|
||||||
|
yyls = yyls1;
|
||||||
|
# else
|
||||||
|
yyoverflow ("parser stack overflow",
|
||||||
|
&yyss1, size * sizeof (*yyssp),
|
||||||
|
&yyvs1, size * sizeof (*yyvsp),
|
||||||
|
&yystacksize);
|
||||||
# endif
|
# endif
|
||||||
|
yyss = yyss1;
|
||||||
|
yyvs = yyvs1;
|
||||||
|
}
|
||||||
#else /* no yyoverflow */
|
#else /* no yyoverflow */
|
||||||
/* Extend the stack our own way. */
|
/* Extend the stack our own way. */
|
||||||
if (yystacksize >= YYMAXDEPTH)
|
if (yystacksize >= YYMAXDEPTH)
|
||||||
|
|||||||
Reference in New Issue
Block a user