From 38ef388759a6a2f97bd7d94f6e4875d3ed689ff6 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/coreclr/inc/safemath.h b/src/coreclr/inc/safemath.h index 3c020de6884781..f1b0300d581954 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)