bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug bison 1.29c


From: Akim Demaille
Subject: Re: Bug bison 1.29c
Date: 10 Oct 2001 17:01:48 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

|  I think there is a bug in bison 1.29c (and previous) when you try not
|  to use "alloca" in bison.simple, by defining YYSTACK_USE_ALLOCA to 0
|  (I have to do so to be able to compile bison generated files on HP-UX
|  systems using C++ old CC compiler (aCC is fine)).
| 
|   I think the test line 419 should be :
|  # if !defined(YYSTACK_USE_ALLOCA) || (YYSTACK_USE_ALLOC == 0)
| instead of :
|  # ifndef YYSTACK_USE_ALLOCA
| 
|   Without this mod, the allocated blocks are not freed.

Good call, thanks!  I'm installing this on both branches:

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
        Use `#if YYSTACK_USE_ALLOCA', not `#ifdef'.
        Reported by Airy ANDRE.

Index: THANKS
===================================================================
RCS file: /cvsroot/bison/bison/THANKS,v
retrieving revision 1.10.2.5
diff -u -u -r1.10.2.5 THANKS
--- THANKS 2001/10/02 16:17:41 1.10.2.5
+++ THANKS 2001/10/10 14:50:00
@@ -1,6 +1,7 @@
 Bison was originally written by Robert Corbett.  It would not be what
 it is today without the invaluable help of these people:
 
+Airy ANDRE              address@hidden
 Akim Demaille           address@hidden
 Albert Chin-A-Young     address@hidden
 Alexander Belopolsky    address@hidden
Index: src/bison.simple
===================================================================
RCS file: /cvsroot/bison/bison/src/bison.simple,v
retrieving revision 1.53.2.1
diff -u -u -r1.53.2.1 bison.simple
--- src/bison.simple 2001/08/29 12:21:38 1.53.2.1
+++ src/bison.simple 2001/10/10 14:50:00
@@ -72,6 +72,10 @@
 # endif /* alloca not defined */
 #endif /* YYSTACK_USE_ALLOCA not defined */
 
+#ifndef YYSTACK_USE_ALLOCA
+# define YYSTACK_USE_ALLOCA 0
+#endif
+
 #if YYSTACK_USE_ALLOCA
 # define YYSTACK_ALLOC alloca
 #else
@@ -358,7 +362,7 @@
      have just been pushed. so pushing a state here evens the stacks.
      */
   yyssp++;
-  
+
  yysetstate:
   *yyssp = yystate;
 
@@ -416,7 +420,7 @@
       yystacksize *= 2;
       if (yystacksize > YYMAXDEPTH)
        yystacksize = YYMAXDEPTH;
-# ifndef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
       yyfree_stacks = 1;
 # endif
       yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]