diff --git a/src/idl_gen_general.cpp b/src/idl_gen_general.cpp index 2f78ae8c0..47e035b8b 100644 --- a/src/idl_gen_general.cpp +++ b/src/idl_gen_general.cpp @@ -1270,7 +1270,7 @@ class GeneralGenerator : public BaseGenerator { code += MakeCamel(field.name, lang_.first_camel_upper); code += "Bytes() { return "; code += lang_.accessor_prefix + "__vector_as_arraysegment("; - code += NumToString(field.value.offset); + code += NumToString(field.value.offset); code += "); }\n"; code += "#endif\n"; @@ -1784,7 +1784,7 @@ bool GenerateBinary(const Parser &parser, const std::string &path, const std::string &file_name) { if (parser.opts.use_flexbuffers) { auto data_vec = parser.flex_builder_.GetBuffer(); - auto data_ptr = reinterpret_cast(data_vec.data()); + auto data_ptr = reinterpret_cast(data(data_vec)); return !parser.flex_builder_.GetSize() || flatbuffers::SaveFile( BinaryFileName(parser, path, file_name).c_str(), data_ptr,