]> 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:31:47 +0000 (23:31 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 Nov 2001 23:31:47 +0000 (23:31 +0000)
use alloca when we didn't want to, and vice versa.

ChangeLog
src/bison.simple

index 51db4e6dc05a27771739f1c53dfa15d5ab0239d5..e6847a1c8524d66346ca26dfae6f17dadc476117 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  Akim Demaille  <akim@epita.fr>
 
        * tests/torture.at (Exploding the Stack Size with Malloc):
index 98fa0c4bdaeec1bbf2d8b6df48ddd02d214d8bf6..fa23877fa9414f02275046d6cdc54236df5f9c2d 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