From: Akim Demaille Date: Sat, 22 Sep 2001 17:57:59 +0000 (+0000) Subject: * src/gram.c (gram_free): Rename back as... X-Git-Tag: BISON-1_29b~9 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/c6e1f6235a94d106425b6e0b80aacfc44713c7fa?ds=inline * src/gram.c (gram_free): Rename back as... (dummy): this. (output_token_translations): Free `token_translations'. * src/symtab.c (free_symtab): Free the tag field. --- diff --git a/ChangeLog b/ChangeLog index e1d6e882..3f24b1ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-09-22 Akim Demaille + + * src/gram.c (gram_free): Rename back as... + (dummy): this. + (output_token_translations): Free `token_translations'. + * src/symtab.c (free_symtab): Free the tag field. + 2001-09-22 Akim Demaille Remove `translations' as it is always set to true. diff --git a/src/gram.c b/src/gram.c index 2cab907c..7016ab91 100644 --- a/src/gram.c +++ b/src/gram.c @@ -52,10 +52,10 @@ int pure_parser; int error_token_number; -/* Free all the memory associated to these pointers. */ +/* This is to avoid linker problems which occur on VMS when using GCC, + when the file in question contains data definitions only. */ void -gram_free (void) +dummy (void) { - } diff --git a/src/output.c b/src/output.c index b782cdff..83476c5f 100644 --- a/src/output.c +++ b/src/output.c @@ -110,17 +110,17 @@ extern void berror PARAMS((const char *)); static int nvectors; static int nentries; -static short **froms; -static short **tos; -static short *tally; -static short *width; -static short *actrow; -static short *state_count; -static short *order; -static short *base; -static short *pos; -static short *table; -static short *check; +static short **froms = NULL; +static short **tos = NULL; +static short *tally = NULL; +static short *width = NULL; +static short *actrow = NULL; +static short *state_count = NULL; +static short *order = NULL; +static short *base = NULL; +static short *pos = NULL; +static short *table = NULL; +static short *check = NULL; static int lowzero; static int high; @@ -306,6 +306,8 @@ output_token_translations (void) ntokens < 127 ? "char" : "short", "yytranslate", token_translations, 0, 1, max_user_token_number + 1); + + XFREE (token_translations); } diff --git a/src/reader.c b/src/reader.c index 6de1222b..0517abdc 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1751,7 +1751,6 @@ packsymbols (void) user_toknums[bp->value] = bp->user_token_number; sprec[bp->value] = bp->prec; sassoc[bp->value] = bp->assoc; - } token_translations = XCALLOC (short, max_user_token_number + 1); diff --git a/src/symtab.c b/src/symtab.c index 84479da2..bf4a882f 100644 --- a/src/symtab.c +++ b/src/symtab.c @@ -143,6 +143,7 @@ free_symtab (void) if (bp->type_name) XFREE (bp->type_name); #endif + XFREE (bp->tag); XFREE (bp); bp = bptmp; }