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 :)
This commit is contained in:
Björn Harrtell 2019-10-18 00:47:51 +02:00 committed by Wouter van Oortmerssen
parent e9d29c21a7
commit fbc11e8aec
1 changed files with 1 additions and 0 deletions

View File

@ -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<size_t>(table - buf_);