Fixed CreateStruct not testing for nesting.

Change-Id: I16bf46682ad68c62b778ed1514b6b706c8cb8f6f
Tested: on Linux.
parent 85b131a7
...@@ -1446,6 +1446,7 @@ class FlatBufferBuilder ...@@ -1446,6 +1446,7 @@ class FlatBufferBuilder
/// @brief Write a struct by itself, typically to be part of a union. /// @brief Write a struct by itself, typically to be part of a union.
template<typename T> Offset<const T *> CreateStruct(const T &structobj) { template<typename T> Offset<const T *> CreateStruct(const T &structobj) {
NotNested();
Align(AlignOf<T>()); Align(AlignOf<T>());
buf_.push_small(structobj); buf_.push_small(structobj);
return Offset<const T *>(GetSize()); return Offset<const T *>(GetSize());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment