From b20801ca4022fc1859a4c077daa0db2b1b6b24ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Harrtell?= Date: Mon, 9 Dec 2019 19:06:04 +0100 Subject: [PATCH] Supress unsigned-integer-overflow for PaddingBytes (#5647) --- include/flatbuffers/base.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h index 86ecf2386..48f91d600 100644 --- a/include/flatbuffers/base.h +++ b/include/flatbuffers/base.h @@ -382,6 +382,7 @@ template __supress_ubsan__("alignment") void WriteScalar(void *p, Of // Computes how many bytes you'd have to pad to be able to write an // "scalar_size" scalar if the buffer had grown to "buf_size" (downwards in // memory). +__supress_ubsan__("unsigned-integer-overflow") inline size_t PaddingBytes(size_t buf_size, size_t scalar_size) { return ((~buf_size) + 1) & (scalar_size - 1); }