From a6764b9bf14215748af095dd9ef238a9dd258789 Mon Sep 17 00:00:00 2001 From: lakedaemon Date: Fri, 8 Jul 2016 22:51:31 +0200 Subject: [PATCH] same fix for general code generator --- src/idl_gen_general.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/idl_gen_general.cpp b/src/idl_gen_general.cpp index a96609c54..96e0e7bde 100644 --- a/src/idl_gen_general.cpp +++ b/src/idl_gen_general.cpp @@ -193,8 +193,9 @@ class GeneralGenerator : public BaseGenerator { public: GeneralGenerator(const Parser &parser, const std::string &path, const std::string &file_name) - : BaseGenerator(parser, path, file_name, "", "."){ - assert(parser_.opts.lang <= IDLOptions::kMAX); + : BaseGenerator(parser, path, file_name, "", "."), + lang_(language_parameters[parser_.opts.lang]) { + assert(parser_.opts.lang <= IDLOptions::kMAX); }; bool generate() { std::string one_file_code; @@ -1127,7 +1128,7 @@ void GenStruct(StructDef &struct_def, std::string *code_ptr) { } code += "};\n\n"; } - const LanguageParameters & lang_ = language_parameters[parser_.opts.lang]; + const LanguageParameters & lang_; }; } // namespace general