mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 16:53:02 +00:00
* src/bison.simple (YYSTACK_REALLOC): New.
(yyparse) [!yyoverflow]: Use it and free the old stack. Reported by FIXME: Who.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2001-11-12 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/bison.simple (YYSTACK_REALLOC): New.
|
||||||
|
(yyparse) [!yyoverflow]: Use it and free the old stack.
|
||||||
|
Reported by FIXME: Who.
|
||||||
|
|
||||||
2001-11-05 Akim Demaille <akim@epita.fr>
|
2001-11-05 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
Version 1.30a.
|
Version 1.30a.
|
||||||
|
|||||||
3
THANKS
3
THANKS
@@ -2,7 +2,7 @@ Bison was originally written by Robert Corbett. It would not be what
|
|||||||
it is today without the invaluable help of these people:
|
it is today without the invaluable help of these people:
|
||||||
|
|
||||||
Airy Andre Airy.Andre@edf.fr
|
Airy Andre Airy.Andre@edf.fr
|
||||||
Akim Demaille akim@epita.fr
|
Akim Demaille akim@freefriends.org
|
||||||
Albert Chin-A-Young china@thewrittenword.com
|
Albert Chin-A-Young china@thewrittenword.com
|
||||||
Alexander Belopolsky alexb@rentec.com
|
Alexander Belopolsky alexb@rentec.com
|
||||||
Daniel Hagerty hag@gnu.org
|
Daniel Hagerty hag@gnu.org
|
||||||
@@ -20,6 +20,7 @@ Neil Booth NeilB@earthling.net
|
|||||||
Noah Friedman friedman@gnu.org
|
Noah Friedman friedman@gnu.org
|
||||||
Pascal Bart pascal.bart@epita.fr
|
Pascal Bart pascal.bart@epita.fr
|
||||||
Paul Eggert eggert@twinsun.com
|
Paul Eggert eggert@twinsun.com
|
||||||
|
Per Allansson per@appgate.com
|
||||||
Piotr Gackiewicz gacek@intertel.com.pl
|
Piotr Gackiewicz gacek@intertel.com.pl
|
||||||
Richard Stallman rms@gnu.org
|
Richard Stallman rms@gnu.org
|
||||||
Robert Anisko anisko_r@epita.fr
|
Robert Anisko anisko_r@epita.fr
|
||||||
|
|||||||
@@ -76,10 +76,27 @@
|
|||||||
# define YYSTACK_USE_ALLOCA 0
|
# define YYSTACK_USE_ALLOCA 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Realloc WHAT from SIZE to YYSTACKSIZE elements of TYPE.
|
||||||
|
If WHAT was malloc'ed (not the original automatic ARRAY), free it. */
|
||||||
#if YYSTACK_USE_ALLOCA
|
#if YYSTACK_USE_ALLOCA
|
||||||
# define YYSTACK_ALLOC alloca
|
# define YYSTACK_REALLOC(Type, What, Array) \
|
||||||
|
do { \
|
||||||
|
Type *old = What; \
|
||||||
|
What = (Type *) malloc (yystacksize * sizeof (Type)); \
|
||||||
|
__yy_memcpy ((char *) What, (char *) old, \
|
||||||
|
(size) * (unsigned int) sizeof (Type)); \
|
||||||
|
yyfree_stacks = 1; \
|
||||||
|
if (old != Array) \
|
||||||
|
free (old); \
|
||||||
|
} while (0)
|
||||||
#else
|
#else
|
||||||
# define YYSTACK_ALLOC malloc
|
# define YYSTACK_REALLOC(Type, What, Array) \
|
||||||
|
do { \
|
||||||
|
Type *old = What; \
|
||||||
|
What = (Type *) alloca (yystacksize * sizeof (Type)); \
|
||||||
|
__yy_memcpy ((char *) What, (char *) old, \
|
||||||
|
(size) * (unsigned int) sizeof (Type)); \
|
||||||
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define yyerrok (yyerrstatus = 0)
|
#define yyerrok (yyerrstatus = 0)
|
||||||
@@ -291,7 +308,7 @@ yyparse (YYPARSE_PARAM_ARG)
|
|||||||
|
|
||||||
/* Three stacks and their tools:
|
/* Three stacks and their tools:
|
||||||
`yyss': related to states,
|
`yyss': related to states,
|
||||||
`yysv': related to semantic values,
|
`yyvs': related to semantic values,
|
||||||
`yyls': related to locations.
|
`yyls': related to locations.
|
||||||
|
|
||||||
Refer to the stacks thru separate pointers, to allow yyoverflow
|
Refer to the stacks thru separate pointers, to allow yyoverflow
|
||||||
@@ -420,19 +437,11 @@ yyparse (YYPARSE_PARAM_ARG)
|
|||||||
yystacksize *= 2;
|
yystacksize *= 2;
|
||||||
if (yystacksize > YYMAXDEPTH)
|
if (yystacksize > YYMAXDEPTH)
|
||||||
yystacksize = YYMAXDEPTH;
|
yystacksize = YYMAXDEPTH;
|
||||||
# if !YYSTACK_USE_ALLOCA
|
|
||||||
yyfree_stacks = 1;
|
YYSTACK_REALLOC (short, yyss, yyssa);
|
||||||
# endif
|
YYSTACK_REALLOC (YYSTYPE, yyvs, yyvsa);
|
||||||
yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
|
|
||||||
__yy_memcpy ((char *)yyss, (char *)yyss1,
|
|
||||||
size * (unsigned int) sizeof (*yyssp));
|
|
||||||
yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
|
|
||||||
__yy_memcpy ((char *)yyvs, (char *)yyvs1,
|
|
||||||
size * (unsigned int) sizeof (*yyvsp));
|
|
||||||
# if YYLSP_NEEDED
|
# if YYLSP_NEEDED
|
||||||
yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
|
YYSTACK_REALLOC (YYLTYPE, yyls, yylsa);
|
||||||
__yy_memcpy ((char *)yyls, (char *)yyls1,
|
|
||||||
size * (unsigned int) sizeof (*yylsp));
|
|
||||||
# endif
|
# endif
|
||||||
#endif /* no yyoverflow */
|
#endif /* no yyoverflow */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user