diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index d5f53bf7b..91dce85a9 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -676,7 +676,9 @@ class Verifier { // Verify any range within the buffer. bool Verify(const void *elem, size_t elem_len) const { bool ok = elem >= buf_ && elem <= end_ - elem_len; - assert(ok); + #ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE + assert(ok); + #endif return ok; }