From d15e2a2f73be35952f356eb248a7278c42cc0094 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 28 Aug 2008 12:07:51 -0700 Subject: [PATCH] Work around a flex limitation with yyrestart() See the comments added with this patch for more information. --- ivlpp/lexor.lex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ivlpp/lexor.lex b/ivlpp/lexor.lex index 1624f172a..492b07a13 100644 --- a/ivlpp/lexor.lex +++ b/ivlpp/lexor.lex @@ -1588,6 +1588,12 @@ static int load_next_input() if(depend_file) fprintf(depend_file, "%s\n", istack->path); + /* This works around an issue in flex yyrestart() where it + * uses yyin to create a new buffer when one does not exist. + * I would have assumed that it would use the file argument. + * The problem is that we have deleted the buffer and freed + * yyin (isp->file) above. */ + yyin = 0; yyrestart(istack->file); return 1; }