From 648185ab4a265a28758e3b5d9f34c68bdf05fef7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 27 Nov 2001 23:19:14 +0000 Subject: [PATCH] * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to use alloca when we didn't want to, and vice versa. --- ChangeLog | 5 +++++ src/bison.simple | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index eec6aa99..3723d6e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-11-27 Paul Eggert + + * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to + use alloca when we didn't want to, and vice versa. + 2001-11-27 Marc Autret * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle initialization. diff --git a/src/bison.simple b/src/bison.simple index 4a3ca508..455c9d87 100644 --- a/src/bison.simple +++ b/src/bison.simple @@ -106,6 +106,14 @@ If WHAT was malloc'ed (not the original automatic ARRAY), free it. */ #if YYSTACK_USE_ALLOCA # 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) +#else +# define YYSTACK_REALLOC(Type, What, Array) \ do { \ Type *old = What; \ What = (Type *) malloc (yystacksize * sizeof (Type)); \ @@ -115,14 +123,6 @@ do { \ if (old != Array) \ free (old); \ } while (0) -#else -# 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 #define YYBISON 1 /* Identify Bison output. */