mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 08:28:05 +00:00
Fixed CreateStruct not testing for nesting.
Change-Id: I16bf46682ad68c62b778ed1514b6b706c8cb8f6f Tested: on Linux.
This commit is contained in:
@@ -413,7 +413,7 @@ class DetachedBuffer {
|
|||||||
: allocator_(other.allocator_), own_allocator_(other.own_allocator_),
|
: allocator_(other.allocator_), own_allocator_(other.own_allocator_),
|
||||||
buf_(other.buf_), reserved_(other.reserved_), cur_(other.cur_),
|
buf_(other.buf_), reserved_(other.reserved_), cur_(other.cur_),
|
||||||
size_(other.size_) {
|
size_(other.size_) {
|
||||||
other.reset();
|
other.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
DetachedBuffer &operator=(DetachedBuffer &&other) {
|
DetachedBuffer &operator=(DetachedBuffer &&other) {
|
||||||
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user