diff options
author | Aditya Mandaleeka <adityam@microsoft.com> | 2016-01-13 16:38:34 -0800 |
---|---|---|
committer | Aditya Mandaleeka <adityam@microsoft.com> | 2016-01-15 19:47:59 -0800 |
commit | 07eb08f918846f0e7bcb5fc5eda0d0865a910a98 (patch) | |
tree | bcb4fe106ae4a486c69f737ee6817efd24a53764 /src/vm/exceptionhandling.cpp | |
parent | acdee68f193eca1cb0f9f5c9244f412707df7b90 (diff) | |
download | coreclr-07eb08f918846f0e7bcb5fc5eda0d0865a910a98.tar.gz coreclr-07eb08f918846f0e7bcb5fc5eda0d0865a910a98.tar.bz2 coreclr-07eb08f918846f0e7bcb5fc5eda0d0865a910a98.zip |
Add support for GCStress 0xC.
Diffstat (limited to 'src/vm/exceptionhandling.cpp')
-rw-r--r-- | src/vm/exceptionhandling.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vm/exceptionhandling.cpp b/src/vm/exceptionhandling.cpp index 4441f3b039..04d5c69ae2 100644 --- a/src/vm/exceptionhandling.cpp +++ b/src/vm/exceptionhandling.cpp @@ -156,6 +156,9 @@ void InitializeExceptionHandling() #ifdef FEATURE_PAL // Register handler of hardware exceptions like null reference in PAL PAL_SetHardwareExceptionHandler(HandleHardwareException); + + // Register handler for determining whether the specified IP has code that is a GC marker for GCCover + PAL_SetGetGcMarkerExceptionCode(GetGcMarkerExceptionCode); #endif // FEATURE_PAL } @@ -5039,8 +5042,15 @@ VOID PALAPI HandleHardwareException(PAL_SEHException* ex) // A hardware exception is handled only if it happened in a jitted code or // in one of the JIT helper functions (JIT_MemSet, ...) PCODE controlPc = GetIP(&ex->ContextRecord); - if (ExecutionManager::IsManagedCode(controlPc) || IsIPInMarkedJitHelper(controlPc)) + BOOL isInManagedCode = ExecutionManager::IsManagedCode(controlPc); + if (isInManagedCode || IsIPInMarkedJitHelper(controlPc)) { + if (isInManagedCode && IsGcMarker(ex->ExceptionRecord.ExceptionCode, &ex->ContextRecord)) + { + RtlRestoreContext(&ex->ContextRecord, &ex->ExceptionRecord); + UNREACHABLE(); + } + // Create frame necessary for the exception handling FrameWithCookie<FaultingExceptionFrame> fef; #if defined(WIN64EXCEPTIONS) |