Skip to content

Commit 38ef388

Browse files
committed
Workaround for dotnet#93442
1 parent 21783bb commit 38ef388

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/coreclr/inc/safemath.h

+6
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,9 @@ template<typename T> class ClrSafeInt
481481
Which ought to inline nicely
482482
*/
483483
// Returns true if safe, false for overflow.
484+
#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442
485+
#pragma optimize("", off)
486+
#endif
484487
static bool multiply(T lhs, T rhs, T &result)
485488
{
486489
if(Is64Bit())
@@ -675,6 +678,9 @@ template<typename T> class ClrSafeInt
675678
}
676679
}
677680
}
681+
#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442
682+
#pragma optimize("", on)
683+
#endif
678684

679685
// Returns true if safe, false on overflow
680686
static inline bool addition(T lhs, T rhs, T &result)

0 commit comments

Comments
 (0)