From b65534e5a42df3058ebca6aa7e0a726af59184ce Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 15 Oct 1995 20:01:09 +0000 Subject: [PATCH] (resolve_sr_conflict): Remove use of alloca. --- src/conflicts.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/conflicts.c b/src/conflicts.c index a054dbd0..29656f32 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -1,5 +1,5 @@ /* Find and resolve or report look-ahead conflicts for bison, - Copyright (C) 1984, 1989 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1992 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -17,9 +17,6 @@ You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef _AIX - #pragma alloca -#endif #include #include "system.h" #include "machine.h" @@ -29,19 +26,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "state.h" -#ifndef __GNUC__ -#undef alloca -#define alloca __builtin_alloca -#else -#ifdef HAVE_ALLOCA_H -#include -#else -#ifndef _AIX -extern char *alloca (); -#endif -#endif -#endif - extern char **tags; extern int tokensetsize; extern char *consistent; @@ -190,8 +174,7 @@ int lookaheadnum; register unsigned *fp1; register unsigned *fp2; register int redprec; - /* Extra parens avoid errors on Ultrix 4.3. */ - errs *errp = (errs *) alloca ((sizeof(errs) + ntokens * sizeof(short))); + errs *errp = (errs *) xmalloc (sizeof(errs) + ntokens * sizeof(short)); short *errtokens = errp->errs; /* find the rule to reduce by to get precedence of reduction */ @@ -276,6 +259,7 @@ int lookaheadnum; } else err_table[state] = 0; + free(errp); } @@ -644,7 +628,7 @@ int state; fp3 = lookaheadset; while (fp3 < fp4) - *fp3++ = *fp1++ & ( ~ (*fp2++)); + *fp3++ = *fp1++ & (~(*fp2++)); count = 0; mask = 1; -- 2.50.0