diff --git a/compiler-rt/include/fuzzer/FuzzedDataProvider.h b/compiler-rt/include/fuzzer/FuzzedDataProvider.h --- a/compiler-rt/include/fuzzer/FuzzedDataProvider.h +++ b/compiler-rt/include/fuzzer/FuzzedDataProvider.h @@ -209,7 +209,7 @@ abort(); // Use the biggest type possible to hold the range and the result. - uint64_t range = static_cast(max) - min; + uint64_t range = static_cast(max) - static_cast(min); uint64_t result = 0; size_t offset = 0; @@ -230,7 +230,7 @@ if (range != std::numeric_limits::max()) result = result % (range + 1); - return static_cast(min + result); + return static_cast(static_cast(min) + result); } // Returns a floating point value in the range [Type's lowest, Type's max] by