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.
This commit is contained in:
Cary R 2008-06-25 10:56:31 -07:00 committed by Stephen Williams
parent f418bea775
commit 22ad8c42bc
1 changed files with 2 additions and 0 deletions

View File

@ -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));