(Improper handling of embedded actions and dollar(-N) in GLR parsers):
Close memory leak reported by twlevo.
+2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/glr-regression.at
+ (Improper handling of embedded actions and dollar(-N) in GLR parsers):
+ Close memory leak reported by twlevo.
+
2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
* data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
/* Reported by S. Eken */
%{
- #define YYSTYPE char const *
+ #define YYSTYPE char *
#include <ctype.h>
#include <stdio.h>
's' var 't'
{ printf ("Variable: '%s'\n", $2); }
'v' 'x' 'q'
+ { free ($2); }
| 's' var_list 't' 'e'
- { printf ("Varlist: '%s'\n", $2); }
+ { printf ("Varlist: '%s'\n", $2); free ($2); }
| 's' var 't' var_printer 'x'
+ { free ($2); }
;
var:
{ $$ = $1; }
| var ',' var_list
{
- char *s = (char *) malloc (strlen ($1) + 1 + strlen ($3) + 1);
- strcpy (s, $1);
+ char *s = (char *) realloc ($1, strlen ($1) + 1 + strlen ($3) + 1);
strcat (s, ",");
strcat (s, $3);
+ free ($3);
$$ = s;
}
;