diff --git a/tensorflow/compiler/mlir/lite/core/model_builder_base.h b/tensorflow/compiler/mlir/lite/core/model_builder_base.h index 3484f4e3d071d6..6856ac7260550c 100644 --- a/tensorflow/compiler/mlir/lite/core/model_builder_base.h +++ b/tensorflow/compiler/mlir/lite/core/model_builder_base.h @@ -386,9 +386,15 @@ class FlatBufferModelBase { size_t allocation_size = std::min(allocation->bytes(), static_cast(FLATBUFFERS_MAX_BUFFER_SIZE - 1)); + flatbuffers::Verifier::Options options; + // TODO(b/366118885): Remove after the root cause of the crash on Windows + // is found. +#if defined(_WIN32) + options.assert = true; +#endif flatbuffers::Verifier base_verifier( - reinterpret_cast(allocation->base()), - allocation_size); + reinterpret_cast(allocation->base()), allocation_size, + options); if (!VerifyModelBuffer(base_verifier)) { TF_LITE_REPORT_ERROR(error_reporter, "The model is not a valid Flatbuffer buffer");