diff --git a/src/coreclr/inc/safemath.h b/src/coreclr/inc/safemath.h index 3c020de688478..f1b0300d58195 100644 --- a/src/coreclr/inc/safemath.h +++ b/src/coreclr/inc/safemath.h @@ -481,6 +481,9 @@ template class ClrSafeInt Which ought to inline nicely */ // Returns true if safe, false for overflow. +#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442 +#pragma optimize("", off) +#endif static bool multiply(T lhs, T rhs, T &result) { if(Is64Bit()) @@ -675,6 +678,9 @@ template class ClrSafeInt } } } +#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442 +#pragma optimize("", on) +#endif // Returns true if safe, false on overflow static inline bool addition(T lhs, T rhs, T &result)