summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2022-01-14 14:39:15 -0800
committerGitHub <noreply@github.com>2022-01-14 14:39:15 -0800
commita42e898979cc828a35aefcc469fec896175fa8e6 (patch)
tree681d9e3727a673dd19348a9c3a53bfd3def2a72a /samples
parent96cc2f3ee329bd81df4ac82c3322a4cf7cecb78f (diff)
downloadflatbuffers-a42e898979cc828a35aefcc469fec896175fa8e6.tar.gz
flatbuffers-a42e898979cc828a35aefcc469fec896175fa8e6.tar.bz2
flatbuffers-a42e898979cc828a35aefcc469fec896175fa8e6.zip
Added verifier alignment checking to table fields (#7018)
Diffstat (limited to 'samples')
-rw-r--r--samples/monster_generated.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/samples/monster_generated.h b/samples/monster_generated.h
index efddb8d0..b3fc655b 100644
--- a/samples/monster_generated.h
+++ b/samples/monster_generated.h
@@ -322,18 +322,18 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
- VerifyField<MyGame::Sample::Vec3>(verifier, VT_POS) &&
- VerifyField<int16_t>(verifier, VT_MANA) &&
- VerifyField<int16_t>(verifier, VT_HP) &&
+ VerifyField<MyGame::Sample::Vec3>(verifier, VT_POS, 4) &&
+ VerifyField<int16_t>(verifier, VT_MANA, 2) &&
+ VerifyField<int16_t>(verifier, VT_HP, 2) &&
VerifyOffset(verifier, VT_NAME) &&
verifier.VerifyString(name()) &&
VerifyOffset(verifier, VT_INVENTORY) &&
verifier.VerifyVector(inventory()) &&
- VerifyField<int8_t>(verifier, VT_COLOR) &&
+ VerifyField<int8_t>(verifier, VT_COLOR, 1) &&
VerifyOffset(verifier, VT_WEAPONS) &&
verifier.VerifyVector(weapons()) &&
verifier.VerifyVectorOfTables(weapons()) &&
- VerifyField<uint8_t>(verifier, VT_EQUIPPED_TYPE) &&
+ VerifyField<uint8_t>(verifier, VT_EQUIPPED_TYPE, 1) &&
VerifyOffset(verifier, VT_EQUIPPED) &&
VerifyEquipment(verifier, equipped(), equipped_type()) &&
VerifyOffset(verifier, VT_PATH) &&
@@ -484,7 +484,7 @@ struct Weapon FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_NAME) &&
verifier.VerifyString(name()) &&
- VerifyField<int16_t>(verifier, VT_DAMAGE) &&
+ VerifyField<int16_t>(verifier, VT_DAMAGE, 2) &&
verifier.EndTable();
}
WeaponT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;