diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2017-08-14 10:41:39 -0700 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2017-08-14 10:41:39 -0700 |
commit | 432e7582c65aeb65b582724f601fc3202ecf9017 (patch) | |
tree | 7cb8964df131f2593a07e7b14af8b8df2609bede | |
parent | d76113100af0f76642e61816288b019190443af8 (diff) | |
download | flatbuffers-432e7582c65aeb65b582724f601fc3202ecf9017.tar.gz flatbuffers-432e7582c65aeb65b582724f601fc3202ecf9017.tar.bz2 flatbuffers-432e7582c65aeb65b582724f601fc3202ecf9017.zip |
Fixed file_identifier/extension leaking from included file.
Change-Id: I470143411e4ce6322e018a27bcc9cd40c15d9bf1
Tested: on Linux.
-rw-r--r-- | src/idl_parser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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 |