]> git.saurik.com Git - bison.git/commitdiff
* src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 Nov 2001 23:19:14 +0000 (23:19 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 Nov 2001 23:19:14 +0000 (23:19 +0000)
use alloca when we didn't want to, and vice versa.

ChangeLog
src/bison.simple

index eec6aa99237a5c491b02b6a4ae058e9c3b0b923a..3723d6e4b6313137d42ee699b1e75956b4395488 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-11-27  Paul Eggert  <eggert@twinsun.com>
+
+       * 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  <autret_m@epita.fr>
 
        * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle initialization.
index 4a3ca508d3e827d2ff0ff3a51631b8c6373003a8..455c9d87319eb0f4c343d4672ac0b9b9ca0c230d 100644 (file)
 # define YYSTACK_REALLOC(Type, What, Array)                            \
 do {                                                                   \
   Type *old = What;                                                    \
-  What = (Type *) malloc (yystacksize * sizeof (Type));                        \
+  What = (Type *) alloca (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
 # define YYSTACK_REALLOC(Type, What, Array)                            \
 do {                                                                   \
   Type *old = What;                                                    \
-  What = (Type *) alloca (yystacksize * sizeof (Type));                        \
+  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)
 #endif