From c2844c7267cd09bfe6b08996777f52f4c086ba12 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Sat, 14 Oct 2023 12:08:22 -0700 Subject: [PATCH] Workaround for https://github.com/dotnet/runtime/issues/93442 --- src/coreclr/inc/safemath.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/coreclr/inc/safemath.h b/src/coreclr/inc/safemath.h index 3f6d5c5716bdb4..fcd51af3de8cb0 100644 --- a/src/coreclr/inc/safemath.h +++ b/src/coreclr/inc/safemath.h @@ -688,6 +688,10 @@ template class ClrSafeInt INDEBUG( mutable bool m_checkedOverflow; ) }; +#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442 +#pragma optimize("", off) +#endif + template <> inline bool ClrSafeInt::multiply(int64_t lhs, int64_t rhs, int64_t &result) { @@ -874,6 +878,10 @@ inline bool ClrSafeInt::multiply(uint8_t lhs, uint8_t rhs, uint8_t &res return true; } +#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442 +#pragma optimize("", on) +#endif + // Allows creation of a ClrSafeInt corresponding to the type of the argument. template ClrSafeInt AsClrSafeInt(T t)