From dca33ddb75a035344cb6ea3e38b9123dcce9b5fd Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 14 Aug 2017 09:22:12 -0700 Subject: [PATCH] Fixed root_type leaking in from included files. Change-Id: I9378e375901f8a883eaeb2182955d690c358ed4b Tested: on Linux. --- src/idl_parser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index 4fb29eac8..213357d70 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -2216,6 +2216,9 @@ 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 + // parent doesn't. + root_struct_def_ = nullptr; // 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