mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
* NEWS: Bison-generated parsers no longer default to using the
alloca function (when available) to extend the parser stack, due to widespread problems in unchecked stack-overflow detection. * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's responsibility to set it to a positive value. This lets the user specify a value that is not a preprocessor constant. * data/yacc.c (YYMAXDEPTH): Likewise. (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero. * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs to be a compile-time constant. However, explain the constraints on it. Also, explain the constraints on YYINITDEPTH. (Table of Symbols): Explain that alloca is no longer the default. Explain the user's responsibility if they define YYSTACK_USE_ALLOCA to 1.
This commit is contained in:
@@ -536,10 +536,6 @@ int yydebug;
|
||||
SIZE_MAX < YYMAXDEPTH * sizeof (GLRStackItem)
|
||||
evaluated with infinite-precision integer arithmetic. */
|
||||
|
||||
#if YYMAXDEPTH == 0
|
||||
# undef YYMAXDEPTH
|
||||
#endif
|
||||
|
||||
#ifndef YYMAXDEPTH
|
||||
# define YYMAXDEPTH ]b4_stack_depth_max[
|
||||
#endif
|
||||
|
||||
12
data/yacc.c
12
data/yacc.c
@@ -226,14 +226,10 @@ b4_syncline([@oline@], [@ofile@])[
|
||||
|
||||
# ifdef YYSTACK_USE_ALLOCA
|
||||
# if YYSTACK_USE_ALLOCA
|
||||
# define YYSTACK_ALLOC alloca
|
||||
# endif
|
||||
# else
|
||||
# if defined (alloca) || defined (_ALLOCA_H)
|
||||
# define YYSTACK_ALLOC alloca
|
||||
# else
|
||||
# ifdef __GNUC__
|
||||
# define YYSTACK_ALLOC __builtin_alloca
|
||||
# else
|
||||
# define YYSTACK_ALLOC alloca
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
@@ -648,10 +644,6 @@ int yydebug;
|
||||
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
|
||||
evaluated with infinite-precision integer arithmetic. */
|
||||
|
||||
#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
|
||||
# undef YYMAXDEPTH
|
||||
#endif
|
||||
|
||||
#ifndef YYMAXDEPTH
|
||||
# define YYMAXDEPTH ]b4_stack_depth_max[
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user