File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,11 @@ namespace detail {
3737 uint64_t val = 0 ;
3838
3939 if (iend - p >= max_varint_length) { // fast path
40- __builtin_assume (iend - p >= max_varint_length);
4140 do {
41+ // GCC 12 has trouble understanding that we're not actually taking this branch for short buffers.
42+ #pragma GCC diagnostic push
43+ #pragma GCC diagnostic ignored "-Warray-bounds"
44+ #endif
4245 int64_t b = *p++;
4346 val = ((static_cast <uint64_t >(b) & 0x7fU ) ); if (b >= 0 ) { break ; }
4447 b = *p++; val |= ((static_cast <uint64_t >(b) & 0x7fU ) << 7U ); if (b >= 0 ) { break ; }
@@ -50,6 +53,7 @@ namespace detail {
5053 b = *p++; val |= ((static_cast <uint64_t >(b) & 0x7fU ) << 49U ); if (b >= 0 ) { break ; }
5154 b = *p++; val |= ((static_cast <uint64_t >(b) & 0x7fU ) << 56U ); if (b >= 0 ) { break ; }
5255 b = *p++; val |= ((static_cast <uint64_t >(b) & 0x01U ) << 63U ); if (b >= 0 ) { break ; }
56+ #pragma GCC diagnostic pop
5357 throw varint_too_long_exception{};
5458 } while (false );
5559 } else {
You can’t perform that action at this time.
0 commit comments