add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-stringop-overflow>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-restrict>)
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Wno-stringop-truncation>)
+ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-class-memaccess>)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
# this warning is only reported by g++ 11 in debug mode when building
# src/coreclr/vm/stackingallocator.h. It is a false-positive, fixed in g++ 12.
# see: https://github.com/dotnet/runtime/pull/69188#issuecomment-1136764770
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-placement-new>)
-
- add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-class-memaccess>)
endif()
if (CMAKE_CXX_COMPILER_ID)
// once and leave them set without the risk of clobbering something we care about.
JIT_DEBUG_INFO Debugger::s_DebuggerLaunchJitInfo = {0};
EXCEPTION_RECORD Debugger::s_DebuggerLaunchJitInfoExceptionRecord = {0};
-CONTEXT Debugger::s_DebuggerLaunchJitInfoContext = {0};
+CONTEXT Debugger::s_DebuggerLaunchJitInfoContext = {};
//----------------------------------------------------------------------------
//
typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
+ _CONTEXT() = default;
+ _CONTEXT(const _CONTEXT& ctx)
+ {
+ *this = ctx;
+ }
+
+ _CONTEXT& operator=(const _CONTEXT& ctx);
+
//
// Register parameter home addresses.
//
#endif
return TRUE;
}
+
+#ifdef HOST_AMD64
+CONTEXT& CONTEXT::operator=(const CONTEXT& ctx)
+{
+ size_t copySize;
+ if (ctx.ContextFlags & CONTEXT_XSTATE & CONTEXT_AREA_MASK)
+ {
+ if ((ctx.XStateFeaturesMask & XSTATE_MASK_AVX512) == XSTATE_MASK_AVX512)
+ {
+ copySize = sizeof(CONTEXT);
+ }
+ else
+ {
+ copySize = offsetof(CONTEXT, KMask0);
+ }
+ }
+ else
+ {
+ copySize = offsetof(CONTEXT, XStateFeaturesMask);
+ }
+
+ memcpy(this, &ctx, copySize);
+
+ return *this;
+}
+#endif // HOST_AMD64
}
CONTRACTL_END;
- CONTEXT _ctx = {0};
+ CONTEXT _ctx = {};
// Ctor will initialize it to NULL
REGDISPLAY regdisp;