From ba563de8777987885c4080b8a53464e427151af1 Mon Sep 17 00:00:00 2001 From: Glenn Fiedler Date: Tue, 25 Nov 2025 14:08:51 -0500 Subject: [PATCH] add assert to fix GCC warning on Ubuntu 24.04 LTS (#8804) --- src/reflection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/reflection.cpp b/src/reflection.cpp index e42baa260..4b2f66daa 100644 --- a/src/reflection.cpp +++ b/src/reflection.cpp @@ -640,6 +640,7 @@ const uint8_t* AddFlatBuffer(std::vector& flatbuf, const uint8_t* newbuf, size_t newlen) { // Align to sizeof(uoffset_t) past sizeof(largest_scalar_t) since we're // going to chop off the root offset. + FLATBUFFERS_ASSERT(newlen >= sizeof(uoffset_t)); while ((flatbuf.size() & (sizeof(uoffset_t) - 1)) || !(flatbuf.size() & (sizeof(largest_scalar_t) - 1))) { flatbuf.push_back(0);