diff options
Diffstat (limited to 'gramar.y')
-rw-r--r-- | gramar.y | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -35,10 +35,10 @@ void addref(char *); extern int yydebug; #endif -struct { +struct pair { unsigned short val; char *label; -} stack[0x100], ref[0x100]; +} *stack, *ref; int sp = 0; int rp = 0; @@ -276,6 +276,8 @@ compile(FILE *fd, size_t sz) { buffer = calloc(sz, sizeof(unsigned short)); label = calloc(sz, sizeof(char *)); + stack = calloc(sz, sizeof(struct pair)); + ref = calloc(sz, sizeof(struct pair)); #if YYDEBUG yydebug = 1; @@ -284,6 +286,9 @@ compile(FILE *fd, size_t sz) yyin = fd; yyparse(); restorerefs(); + + free(ref); + free(stack); free(label); return buffer; |