From 040e2b3259c5b8d316361eacd5e9d0359a5c9965 Mon Sep 17 00:00:00 2001 From: Koundinya Veluri Date: Thu, 6 May 2021 01:16:28 -0700 Subject: [PATCH] Work around a `ClrRestoreNonvolatileContext` issue for a case (#52342) Work around a `ClrRestoreNonvolatileContext` issue for a case --- src/coreclr/vm/exceptionhandling.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp index 03e87dd..11d0072 100644 --- a/src/coreclr/vm/exceptionhandling.cpp +++ b/src/coreclr/vm/exceptionhandling.cpp @@ -1189,6 +1189,12 @@ ProcessCLRException(IN PEXCEPTION_RECORD pExceptionRecord RestoreSOToleranceState(); #endif +#ifdef TARGET_AMD64 + // OSes older than Win8 have a bug where RtlUnwindEx passes meaningless ContextFlags to the personality routine in + // some cases. + pContextRecord->ContextFlags |= CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT; +#endif + ExceptionTracker::ResumeExecution(pContextRecord); UNREACHABLE(); } -- 2.7.4