Fixed CreateStruct not testing for nesting.

Change-Id: I16bf46682ad68c62b778ed1514b6b706c8cb8f6f
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen 2017-12-07 11:15:37 -08:00
parent 85b131a719
commit 67b29d4e43
1 changed files with 2 additions and 1 deletions

View File

@ -1446,6 +1446,7 @@ class FlatBufferBuilder
/// @brief Write a struct by itself, typically to be part of a union.
template<typename T> Offset<const T *> CreateStruct(const T &structobj) {
NotNested();
Align(AlignOf<T>());
buf_.push_small(structobj);
return Offset<const T *>(GetSize());