From 432e7582c65aeb65b582724f601fc3202ecf9017 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 14 Aug 2017 10:41:39 -0700 Subject: Fixed file_identifier/extension leaking from included file. Change-Id: I470143411e4ce6322e018a27bcc9cd40c15d9bf1 Tested: on Linux. --- src/idl_parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index 213357d7..ae3a10cb 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -2216,9 +2216,11 @@ CheckedError Parser::DoParse(const char *source, name.c_str())); // We generally do not want to output code for any included files: if (!opts.generate_all) MarkGenerated(); - // Reset root type just in case the included file had one, and the + // Reset these just in case the included file had them, and the // parent doesn't. root_struct_def_ = nullptr; + file_identifier_.clear(); + file_extension_.clear(); // This is the easiest way to continue this file after an include: // instead of saving and restoring all the state, we simply start the // file anew. This will cause it to encounter the same include -- cgit v1.2.3