summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-04-18 17:27:47 -0400
committerTavian Barnes <tavianator@gmail.com>2010-04-18 17:27:47 -0400
commit11d364ec365c46c21271012b566966d342a90a8b (patch)
tree5c2144da938bf2b7d622da1a6326d09add9f516a
parentcd7cba285144211c5ea1f4573ad729555923dab1 (diff)
downloaddimension-11d364ec365c46c21271012b566966d342a90a8b.tar.xz
Fix segfault on parse error within macro.
The macro token buffer was being freed by both yylex_cleanup() and dmnsn_delete_patricia_trie().
-rw-r--r--dimension/tokenize.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dimension/tokenize.c b/dimension/tokenize.c
index b5a72f1..1fddea3 100644
--- a/dimension/tokenize.c
+++ b/dimension/tokenize.c
@@ -1045,7 +1045,8 @@ dmnsn_yylex_cleanup(void *yyscanner)
}
dmnsn_token_buffer *prev = tbuffer->prev;
- dmnsn_delete_token_buffer(tbuffer);
+ if (tbuffer->type != DMNSN_T_MACRO)
+ dmnsn_delete_token_buffer(tbuffer);
tbuffer = prev;
}
dmnsn_yyset_extra(NULL, yyscanner);