From fbc11e8aecde224fb0884bd0a7a20621f9e3b75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Harrtell?= Date: Fri, 18 Oct 2019 00:47:51 +0200 Subject: [PATCH] Avoid intentional unsigned integer overflow getting caught by sanitizers (#5572) * Avoid intentional unsigned integer overflow getting caught by sanitizers * Adapt from suggested compiler compatible solution * And a third way :) --- include/flatbuffers/flatbuffers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 228c879ab..a4acdf96a 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -2230,6 +2230,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS { return true; } + __supress_ubsan__("unsigned-integer-overflow") bool VerifyTableStart(const uint8_t *table) { // Check the vtable offset. auto tableo = static_cast(table - buf_);