Skip to content

Commit ba563de

Browse files
add assert to fix GCC warning on Ubuntu 24.04 LTS (#8804)
1 parent 46a2f3f commit ba563de

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/reflection.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ const uint8_t* AddFlatBuffer(std::vector<uint8_t>& flatbuf,
640640
const uint8_t* newbuf, size_t newlen) {
641641
// Align to sizeof(uoffset_t) past sizeof(largest_scalar_t) since we're
642642
// going to chop off the root offset.
643+
FLATBUFFERS_ASSERT(newlen >= sizeof(uoffset_t));
643644
while ((flatbuf.size() & (sizeof(uoffset_t) - 1)) ||
644645
!(flatbuf.size() & (sizeof(largest_scalar_t) - 1))) {
645646
flatbuf.push_back(0);

0 commit comments

Comments
 (0)