From 22ad8c42bcc4afaffbdf8a610aa5742ddd02d874 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 25 Jun 2008 10:56:31 -0700 Subject: [PATCH] V0.8: Copy file and line info during a macro expansion. The file and line number information needs to be copied when doing a macro expansion. This prevents a macro that expands to an `ifdef of other construct that needs to push the stack from core dumping because the file is NULL. --- ivlpp/lexor.lex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ivlpp/lexor.lex b/ivlpp/lexor.lex index bc3205540..20f2013e4 100644 --- a/ivlpp/lexor.lex +++ b/ivlpp/lexor.lex @@ -459,6 +459,8 @@ static void def_match() calloc(1, sizeof(struct include_stack_t)); isp->str = cur->value; isp->next = istack; + isp->path = strdup(istack->path); + isp->lineno = istack->lineno; istack->yybs = YY_CURRENT_BUFFER; istack = isp; yy_switch_to_buffer(yy_create_buffer(istack->file, YY_BUF_SIZE));