summaryrefslogtreecommitdiff
path: root/glcpp.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-10 11:52:29 -0700
committerCarl Worth <cworth@cworth.org>2010-05-10 11:52:29 -0700
commit38aa83560be3368b4e9784b3ef8f73144171ca45 (patch)
treedabb8d480013e9862396474656c008fb8b96306b /glcpp.c
parent3a37b8701cd3e0a86fef59910b20b2af7e4573f6 (diff)
Make the lexer reentrant (to avoid "still reachable" memory).
This allows the final program to be 100% "valgrind clean", (freeing all memory that it allocates). This will make it much easier to ensure that any allocation that parser actions perform are also cleaned up.
Diffstat (limited to 'glcpp.c')
-rw-r--r--glcpp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/glcpp.c b/glcpp.c
index 09641ceead..90a0e89cfa 100644
--- a/glcpp.c
+++ b/glcpp.c
@@ -24,5 +24,12 @@
int
main (void)
{
- return yyparse ();
+ int ret;
+ void *scanner;
+
+ yylex_init (&scanner);
+ ret = yyparse (scanner);
+ yylex_destroy (scanner);
+
+ return ret;
}