mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Added functionality to obtain a buffer pointer from a root.
Change-Id: Ia63e41d0304e8668ea4ce09a4c31dd999eb96994 Tested: on Linux. Bug: 32218623
This commit is contained in:
@@ -1352,10 +1352,11 @@ CheckedError Parser::ParseDecl() {
|
||||
auto align = static_cast<size_t>(atoi(force_align->constant.c_str()));
|
||||
if (force_align->type.base_type != BASE_TYPE_INT ||
|
||||
align < struct_def->minalign ||
|
||||
align > 16 ||
|
||||
align > FLATBUFFERS_MAX_ALIGNMENT ||
|
||||
align & (align - 1))
|
||||
return Error("force_align must be a power of two integer ranging from the"
|
||||
"struct\'s natural alignment to 16");
|
||||
"struct\'s natural alignment to " +
|
||||
NumToString(FLATBUFFERS_MAX_ALIGNMENT));
|
||||
struct_def->minalign = align;
|
||||
}
|
||||
struct_def->PadLastField(struct_def->minalign);
|
||||
|
||||
Reference in New Issue
Block a user