diff options
-rw-r--r-- | include/flatbuffers/flatbuffers.h | 19 | ||||
-rw-r--r-- | include/flatbuffers/reflection_generated.h | 63 | ||||
-rw-r--r-- | samples/monster_generated.h | 8 | ||||
-rw-r--r-- | src/idl_gen_cpp.cpp | 6 | ||||
-rw-r--r-- | src/reflection.cpp | 24 | ||||
-rw-r--r-- | tests/monster_test_generated.h | 42 | ||||
-rw-r--r-- | tests/union_vector/union_vector_generated.h | 8 |
7 files changed, 82 insertions, 88 deletions
diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 563afc1d..bfcc7d7d 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -1792,27 +1792,28 @@ class Verifier FLATBUFFERS_FINAL_CLASS { } // Verify a pointer (may be NULL) of any vector type. - template<typename T> bool Verify(const Vector<T> *vec) const { - return !vec || VerifyVector(reinterpret_cast<const uint8_t *>(vec), - sizeof(T)); + template<typename T> bool VerifyVector(const Vector<T> *vec) const { + return !vec || VerifyVectorOrString(reinterpret_cast<const uint8_t *>(vec), + sizeof(T)); } // Verify a pointer (may be NULL) of a vector to struct. - template<typename T> bool Verify(const Vector<const T *> *vec) const { - return Verify(reinterpret_cast<const Vector<T> *>(vec)); + template<typename T> bool VerifyVector(const Vector<const T *> *vec) const { + return VerifyVector(reinterpret_cast<const Vector<T> *>(vec)); } // Verify a pointer (may be NULL) to string. - bool Verify(const String *str) const { + bool VerifyString(const String *str) const { uoffset_t end; return !str || - (VerifyVector(reinterpret_cast<const uint8_t *>(str), 1, &end) && + (VerifyVectorOrString(reinterpret_cast<const uint8_t *>(str), + 1, &end) && Verify(end, 1) && // Must have terminator Check(buf_[end] == '\0')); // Terminating byte must be 0. } // Common code between vectors and strings. - bool VerifyVector(const uint8_t *vec, size_t elem_size, + bool VerifyVectorOrString(const uint8_t *vec, size_t elem_size, uoffset_t *end = nullptr) const { auto veco = static_cast<uoffset_t>(vec - buf_); // Check we can read the size field. @@ -1832,7 +1833,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS { bool VerifyVectorOfStrings(const Vector<Offset<String>> *vec) const { if (vec) { for (uoffset_t i = 0; i < vec->size(); i++) { - if (!Verify(vec->Get(i))) return false; + if (!VerifyString(vec->Get(i))) return false; } } return true; diff --git a/include/flatbuffers/reflection_generated.h b/include/flatbuffers/reflection_generated.h index 5362fefe..26cdaafa 100644 --- a/include/flatbuffers/reflection_generated.h +++ b/include/flatbuffers/reflection_generated.h @@ -178,9 +178,9 @@ struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_KEY) && - verifier.Verify(key()) && + verifier.VerifyString(key()) && VerifyOffset(verifier, VT_VALUE) && - verifier.Verify(value()) && + verifier.VerifyString(value()) && verifier.EndTable(); } }; @@ -245,14 +245,7 @@ struct EnumVal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { return value() < o->value(); } int KeyCompareWithValue(int64_t val) const { - const auto key = value(); - if (key < val) { - return -1; - } else if (key > val) { - return 1; - } else { - return 0; - } + return static_cast<int>(value() > val) - static_cast<int>(value() < val); } const Object *object() const { return GetPointer<const Object *>(VT_OBJECT); @@ -266,14 +259,14 @@ struct EnumVal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_NAME) && - verifier.Verify(name()) && + verifier.VerifyString(name()) && VerifyField<int64_t>(verifier, VT_VALUE) && VerifyOffset(verifier, VT_OBJECT) && verifier.VerifyTable(object()) && VerifyOffset(verifier, VT_UNION_TYPE) && verifier.VerifyTable(union_type()) && VerifyOffset(verifier, VT_DOCUMENTATION) && - verifier.Verify(documentation()) && + verifier.VerifyVector(documentation()) && verifier.VerifyVectorOfStrings(documentation()) && verifier.EndTable(); } @@ -378,18 +371,18 @@ struct Enum FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_NAME) && - verifier.Verify(name()) && + verifier.VerifyString(name()) && VerifyOffsetRequired(verifier, VT_VALUES) && - verifier.Verify(values()) && + verifier.VerifyVector(values()) && verifier.VerifyVectorOfTables(values()) && VerifyField<uint8_t>(verifier, VT_IS_UNION) && VerifyOffsetRequired(verifier, VT_UNDERLYING_TYPE) && verifier.VerifyTable(underlying_type()) && VerifyOffset(verifier, VT_ATTRIBUTES) && - verifier.Verify(attributes()) && + verifier.VerifyVector(attributes()) && verifier.VerifyVectorOfTables(attributes()) && VerifyOffset(verifier, VT_DOCUMENTATION) && - verifier.Verify(documentation()) && + verifier.VerifyVector(documentation()) && verifier.VerifyVectorOfStrings(documentation()) && verifier.EndTable(); } @@ -523,7 +516,7 @@ struct Field FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_NAME) && - verifier.Verify(name()) && + verifier.VerifyString(name()) && VerifyOffsetRequired(verifier, VT_TYPE) && verifier.VerifyTable(type()) && VerifyField<uint16_t>(verifier, VT_ID) && @@ -534,10 +527,10 @@ struct Field FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyField<uint8_t>(verifier, VT_REQUIRED) && VerifyField<uint8_t>(verifier, VT_KEY) && VerifyOffset(verifier, VT_ATTRIBUTES) && - verifier.Verify(attributes()) && + verifier.VerifyVector(attributes()) && verifier.VerifyVectorOfTables(attributes()) && VerifyOffset(verifier, VT_DOCUMENTATION) && - verifier.Verify(documentation()) && + verifier.VerifyVector(documentation()) && verifier.VerifyVectorOfStrings(documentation()) && verifier.EndTable(); } @@ -689,18 +682,18 @@ struct Object FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_NAME) && - verifier.Verify(name()) && + verifier.VerifyString(name()) && VerifyOffsetRequired(verifier, VT_FIELDS) && - verifier.Verify(fields()) && + verifier.VerifyVector(fields()) && verifier.VerifyVectorOfTables(fields()) && VerifyField<uint8_t>(verifier, VT_IS_STRUCT) && VerifyField<int32_t>(verifier, VT_MINALIGN) && VerifyField<int32_t>(verifier, VT_BYTESIZE) && VerifyOffset(verifier, VT_ATTRIBUTES) && - verifier.Verify(attributes()) && + verifier.VerifyVector(attributes()) && verifier.VerifyVectorOfTables(attributes()) && VerifyOffset(verifier, VT_DOCUMENTATION) && - verifier.Verify(documentation()) && + verifier.VerifyVector(documentation()) && verifier.VerifyVectorOfStrings(documentation()) && verifier.EndTable(); } @@ -816,16 +809,16 @@ struct RPCCall FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_NAME) && - verifier.Verify(name()) && + verifier.VerifyString(name()) && VerifyOffsetRequired(verifier, VT_REQUEST) && verifier.VerifyTable(request()) && VerifyOffsetRequired(verifier, VT_RESPONSE) && verifier.VerifyTable(response()) && VerifyOffset(verifier, VT_ATTRIBUTES) && - verifier.Verify(attributes()) && + verifier.VerifyVector(attributes()) && verifier.VerifyVectorOfTables(attributes()) && VerifyOffset(verifier, VT_DOCUMENTATION) && - verifier.Verify(documentation()) && + verifier.VerifyVector(documentation()) && verifier.VerifyVectorOfStrings(documentation()) && verifier.EndTable(); } @@ -924,15 +917,15 @@ struct Service FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_NAME) && - verifier.Verify(name()) && + verifier.VerifyString(name()) && VerifyOffset(verifier, VT_CALLS) && - verifier.Verify(calls()) && + verifier.VerifyVector(calls()) && verifier.VerifyVectorOfTables(calls()) && VerifyOffset(verifier, VT_ATTRIBUTES) && - verifier.Verify(attributes()) && + verifier.VerifyVector(attributes()) && verifier.VerifyVectorOfTables(attributes()) && VerifyOffset(verifier, VT_DOCUMENTATION) && - verifier.Verify(documentation()) && + verifier.VerifyVector(documentation()) && verifier.VerifyVectorOfStrings(documentation()) && verifier.EndTable(); } @@ -1024,19 +1017,19 @@ struct Schema FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_OBJECTS) && - verifier.Verify(objects()) && + verifier.VerifyVector(objects()) && verifier.VerifyVectorOfTables(objects()) && VerifyOffsetRequired(verifier, VT_ENUMS) && - verifier.Verify(enums()) && + verifier.VerifyVector(enums()) && verifier.VerifyVectorOfTables(enums()) && VerifyOffset(verifier, VT_FILE_IDENT) && - verifier.Verify(file_ident()) && + verifier.VerifyString(file_ident()) && VerifyOffset(verifier, VT_FILE_EXT) && - verifier.Verify(file_ext()) && + verifier.VerifyString(file_ext()) && VerifyOffset(verifier, VT_ROOT_TABLE) && verifier.VerifyTable(root_table()) && VerifyOffset(verifier, VT_SERVICES) && - verifier.Verify(services()) && + verifier.VerifyVector(services()) && verifier.VerifyVectorOfTables(services()) && verifier.EndTable(); } diff --git a/samples/monster_generated.h b/samples/monster_generated.h index 2359ef64..5af2e3bc 100644 --- a/samples/monster_generated.h +++ b/samples/monster_generated.h @@ -269,12 +269,12 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyField<int16_t>(verifier, VT_MANA) && VerifyField<int16_t>(verifier, VT_HP) && VerifyOffset(verifier, VT_NAME) && - verifier.Verify(name()) && + verifier.VerifyString(name()) && VerifyOffset(verifier, VT_INVENTORY) && - verifier.Verify(inventory()) && + verifier.VerifyVector(inventory()) && VerifyField<int8_t>(verifier, VT_COLOR) && VerifyOffset(verifier, VT_WEAPONS) && - verifier.Verify(weapons()) && + verifier.VerifyVector(weapons()) && verifier.VerifyVectorOfTables(weapons()) && VerifyField<uint8_t>(verifier, VT_EQUIPPED_TYPE) && VerifyOffset(verifier, VT_EQUIPPED) && @@ -415,7 +415,7 @@ struct Weapon FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_NAME) && - verifier.Verify(name()) && + verifier.VerifyString(name()) && VerifyField<int16_t>(verifier, VT_DAMAGE) && verifier.EndTable(); } diff --git a/src/idl_gen_cpp.cpp b/src/idl_gen_cpp.cpp index 060f4bc6..5db8e5a0 100644 --- a/src/idl_gen_cpp.cpp +++ b/src/idl_gen_cpp.cpp @@ -1116,7 +1116,7 @@ class CppGenerator : public BaseGenerator { } } else if (ev.union_type.base_type == BASE_TYPE_STRING) { code_ += getptr; - code_ += " return verifier.Verify(ptr);"; + code_ += " return verifier.VerifyString(ptr);"; } else { FLATBUFFERS_ASSERT(false); } @@ -1503,11 +1503,11 @@ class CppGenerator : public BaseGenerator { break; } case BASE_TYPE_STRING: { - code_ += "{{PRE}}verifier.Verify({{NAME}}())\\"; + code_ += "{{PRE}}verifier.VerifyString({{NAME}}())\\"; break; } case BASE_TYPE_VECTOR: { - code_ += "{{PRE}}verifier.Verify({{NAME}}())\\"; + code_ += "{{PRE}}verifier.VerifyVector({{NAME}}())\\"; switch (field.value.type.element) { case BASE_TYPE_STRING: { diff --git a/src/reflection.cpp b/src/reflection.cpp index a5147f0e..61c1ba73 100644 --- a/src/reflection.cpp +++ b/src/reflection.cpp @@ -507,7 +507,7 @@ bool VerifyVectorOfStructs(flatbuffers::Verifier &v, auto p = parent_table.GetPointer<const uint8_t *>(field_offset); if (required && !p) { return false; } - return !p || v.VerifyVector(p, obj.bytesize()); + return !p || v.VerifyVectorOrString(p, obj.bytesize()); } // forward declare to resolve cyclic deps between VerifyObject and VerifyVector @@ -524,29 +524,29 @@ bool VerifyVector(flatbuffers::Verifier &v, const reflection::Schema &schema, switch (vec_field.type()->element()) { case reflection::None: FLATBUFFERS_ASSERT(false); break; case reflection::UType: - return v.Verify(flatbuffers::GetFieldV<uint8_t>(table, vec_field)); + return v.VerifyVector(flatbuffers::GetFieldV<uint8_t>(table, vec_field)); case reflection::Bool: case reflection::Byte: case reflection::UByte: - return v.Verify(flatbuffers::GetFieldV<int8_t>(table, vec_field)); + return v.VerifyVector(flatbuffers::GetFieldV<int8_t>(table, vec_field)); case reflection::Short: case reflection::UShort: - return v.Verify(flatbuffers::GetFieldV<int16_t>(table, vec_field)); + return v.VerifyVector(flatbuffers::GetFieldV<int16_t>(table, vec_field)); case reflection::Int: case reflection::UInt: - return v.Verify(flatbuffers::GetFieldV<int32_t>(table, vec_field)); + return v.VerifyVector(flatbuffers::GetFieldV<int32_t>(table, vec_field)); case reflection::Long: case reflection::ULong: - return v.Verify(flatbuffers::GetFieldV<int64_t>(table, vec_field)); + return v.VerifyVector(flatbuffers::GetFieldV<int64_t>(table, vec_field)); case reflection::Float: - return v.Verify(flatbuffers::GetFieldV<float>(table, vec_field)); + return v.VerifyVector(flatbuffers::GetFieldV<float>(table, vec_field)); case reflection::Double: - return v.Verify(flatbuffers::GetFieldV<double>(table, vec_field)); + return v.VerifyVector(flatbuffers::GetFieldV<double>(table, vec_field)); case reflection::String: { - auto vecString = + auto vec_string = flatbuffers::GetFieldV<flatbuffers::Offset<flatbuffers::String>>( table, vec_field); - if (v.Verify(vecString) && v.VerifyVectorOfStrings(vecString)) { + if (v.VerifyVector(vec_string) && v.VerifyVectorOfStrings(vec_string)) { return true; } else { return false; @@ -564,7 +564,7 @@ bool VerifyVector(flatbuffers::Verifier &v, const reflection::Schema &schema, auto vec = flatbuffers::GetFieldV<flatbuffers::Offset<flatbuffers::Table>>( table, vec_field); - if (!v.Verify(vec)) return false; + if (!v.VerifyVector(vec)) return false; if (vec) { for (uoffset_t j = 0; j < vec->size(); j++) { if (!VerifyObject(v, schema, *obj, vec->Get(j), true)) { @@ -626,7 +626,7 @@ bool VerifyObject(flatbuffers::Verifier &v, const reflection::Schema &schema, break; case reflection::String: if (!table->VerifyField<uoffset_t>(v, field_def->offset()) || - !v.Verify(flatbuffers::GetFieldS(*table, *field_def))) { + !v.VerifyString(flatbuffers::GetFieldS(*table, *field_def))) { return false; } break; diff --git a/tests/monster_test_generated.h b/tests/monster_test_generated.h index 4cb15cd1..3c841b93 100644 --- a/tests/monster_test_generated.h +++ b/tests/monster_test_generated.h @@ -548,7 +548,7 @@ struct Stat FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_ID) && - verifier.Verify(id()) && + verifier.VerifyString(id()) && VerifyField<int64_t>(verifier, VT_VAL) && VerifyField<uint16_t>(verifier, VT_COUNT) && verifier.EndTable(); @@ -1071,25 +1071,25 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyField<int16_t>(verifier, VT_MANA) && VerifyField<int16_t>(verifier, VT_HP) && VerifyOffsetRequired(verifier, VT_NAME) && - verifier.Verify(name()) && + verifier.VerifyString(name()) && VerifyOffset(verifier, VT_INVENTORY) && - verifier.Verify(inventory()) && + verifier.VerifyVector(inventory()) && VerifyField<int8_t>(verifier, VT_COLOR) && VerifyField<uint8_t>(verifier, VT_TEST_TYPE) && VerifyOffset(verifier, VT_TEST) && VerifyAny(verifier, test(), test_type()) && VerifyOffset(verifier, VT_TEST4) && - verifier.Verify(test4()) && + verifier.VerifyVector(test4()) && VerifyOffset(verifier, VT_TESTARRAYOFSTRING) && - verifier.Verify(testarrayofstring()) && + verifier.VerifyVector(testarrayofstring()) && verifier.VerifyVectorOfStrings(testarrayofstring()) && VerifyOffset(verifier, VT_TESTARRAYOFTABLES) && - verifier.Verify(testarrayoftables()) && + verifier.VerifyVector(testarrayoftables()) && verifier.VerifyVectorOfTables(testarrayoftables()) && VerifyOffset(verifier, VT_ENEMY) && verifier.VerifyTable(enemy()) && VerifyOffset(verifier, VT_TESTNESTEDFLATBUFFER) && - verifier.Verify(testnestedflatbuffer()) && + verifier.VerifyVector(testnestedflatbuffer()) && VerifyOffset(verifier, VT_TESTEMPTY) && verifier.VerifyTable(testempty()) && VerifyField<uint8_t>(verifier, VT_TESTBOOL) && @@ -1102,40 +1102,40 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyField<int64_t>(verifier, VT_TESTHASHS64_FNV1A) && VerifyField<uint64_t>(verifier, VT_TESTHASHU64_FNV1A) && VerifyOffset(verifier, VT_TESTARRAYOFBOOLS) && - verifier.Verify(testarrayofbools()) && + verifier.VerifyVector(testarrayofbools()) && VerifyField<float>(verifier, VT_TESTF) && VerifyField<float>(verifier, VT_TESTF2) && VerifyField<float>(verifier, VT_TESTF3) && VerifyOffset(verifier, VT_TESTARRAYOFSTRING2) && - verifier.Verify(testarrayofstring2()) && + verifier.VerifyVector(testarrayofstring2()) && verifier.VerifyVectorOfStrings(testarrayofstring2()) && VerifyOffset(verifier, VT_TESTARRAYOFSORTEDSTRUCT) && - verifier.Verify(testarrayofsortedstruct()) && + verifier.VerifyVector(testarrayofsortedstruct()) && VerifyOffset(verifier, VT_FLEX) && - verifier.Verify(flex()) && + verifier.VerifyVector(flex()) && VerifyOffset(verifier, VT_TEST5) && - verifier.Verify(test5()) && + verifier.VerifyVector(test5()) && VerifyOffset(verifier, VT_VECTOR_OF_LONGS) && - verifier.Verify(vector_of_longs()) && + verifier.VerifyVector(vector_of_longs()) && VerifyOffset(verifier, VT_VECTOR_OF_DOUBLES) && - verifier.Verify(vector_of_doubles()) && + verifier.VerifyVector(vector_of_doubles()) && VerifyOffset(verifier, VT_PARENT_NAMESPACE_TEST) && verifier.VerifyTable(parent_namespace_test()) && VerifyOffset(verifier, VT_VECTOR_OF_REFERRABLES) && - verifier.Verify(vector_of_referrables()) && + verifier.VerifyVector(vector_of_referrables()) && verifier.VerifyVectorOfTables(vector_of_referrables()) && VerifyField<uint64_t>(verifier, VT_SINGLE_WEAK_REFERENCE) && VerifyOffset(verifier, VT_VECTOR_OF_WEAK_REFERENCES) && - verifier.Verify(vector_of_weak_references()) && + verifier.VerifyVector(vector_of_weak_references()) && VerifyOffset(verifier, VT_VECTOR_OF_STRONG_REFERRABLES) && - verifier.Verify(vector_of_strong_referrables()) && + verifier.VerifyVector(vector_of_strong_referrables()) && verifier.VerifyVectorOfTables(vector_of_strong_referrables()) && VerifyField<uint64_t>(verifier, VT_CO_OWNING_REFERENCE) && VerifyOffset(verifier, VT_VECTOR_OF_CO_OWNING_REFERENCES) && - verifier.Verify(vector_of_co_owning_references()) && + verifier.VerifyVector(vector_of_co_owning_references()) && VerifyField<uint64_t>(verifier, VT_NON_OWNING_REFERENCE) && VerifyOffset(verifier, VT_VECTOR_OF_NON_OWNING_REFERENCES) && - verifier.Verify(vector_of_non_owning_references()) && + verifier.VerifyVector(vector_of_non_owning_references()) && verifier.EndTable(); } MonsterT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; @@ -1611,9 +1611,9 @@ struct TypeAliases FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyField<float>(verifier, VT_F32) && VerifyField<double>(verifier, VT_F64) && VerifyOffset(verifier, VT_V8) && - verifier.Verify(v8()) && + verifier.VerifyVector(v8()) && VerifyOffset(verifier, VT_VF64) && - verifier.Verify(vf64()) && + verifier.VerifyVector(vf64()) && verifier.EndTable(); } TypeAliasesT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; diff --git a/tests/union_vector/union_vector_generated.h b/tests/union_vector/union_vector_generated.h index 566e36a0..6ed7435d 100644 --- a/tests/union_vector/union_vector_generated.h +++ b/tests/union_vector/union_vector_generated.h @@ -309,9 +309,9 @@ struct Movie FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyOffset(verifier, VT_MAIN_CHARACTER) && VerifyCharacter(verifier, main_character(), main_character_type()) && VerifyOffset(verifier, VT_CHARACTERS_TYPE) && - verifier.Verify(characters_type()) && + verifier.VerifyVector(characters_type()) && VerifyOffset(verifier, VT_CHARACTERS) && - verifier.Verify(characters()) && + verifier.VerifyVector(characters()) && VerifyCharacterVector(verifier, characters(), characters_type()) && verifier.EndTable(); } @@ -458,11 +458,11 @@ inline bool VerifyCharacter(flatbuffers::Verifier &verifier, const void *obj, Ch } case Character_Other: { auto ptr = reinterpret_cast<const flatbuffers::String *>(obj); - return verifier.Verify(ptr); + return verifier.VerifyString(ptr); } case Character_Unused: { auto ptr = reinterpret_cast<const flatbuffers::String *>(obj); - return verifier.Verify(ptr); + return verifier.VerifyString(ptr); } default: return false; } |