diff options
author | Jonghyun Park <parjong@gmail.com> | 2017-01-24 21:39:37 +0900 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2017-01-24 13:39:37 +0100 |
commit | 617c0cf4448b3728b1f07f9aec5f2dc2a40ce5f9 (patch) | |
tree | 57e3dc023b311c6c0685e28348108affe026ff66 /src/vm/exceptionhandling.cpp | |
parent | 69e3c50ee80a16fd4d2c287422ed7c4d1056b667 (diff) | |
download | coreclr-617c0cf4448b3728b1f07f9aec5f2dc2a40ce5f9.tar.gz coreclr-617c0cf4448b3728b1f07f9aec5f2dc2a40ce5f9.tar.bz2 coreclr-617c0cf4448b3728b1f07f9aec5f2dc2a40ce5f9.zip |
[x86/Linux] Fix EH Region Mismatch (#9043)
Diffstat (limited to 'src/vm/exceptionhandling.cpp')
-rw-r--r-- | src/vm/exceptionhandling.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vm/exceptionhandling.cpp b/src/vm/exceptionhandling.cpp index 5fe8a26ecd..d3485e3671 100644 --- a/src/vm/exceptionhandling.cpp +++ b/src/vm/exceptionhandling.cpp @@ -1376,6 +1376,8 @@ void ExceptionTracker::InitializeCrawlFrame(CrawlFrame* pcfThisFrame, Thread* pT // </ARM and ARM64> pThread->InitRegDisplay(pcfThisFrame->pRD, pDispatcherContext->ContextRecord, true); + bool fAdjustRegdisplayControlPC = false; + // The "if" check below is trying to determine when we have a valid current context in DC->ContextRecord and whether, or not, // RegDisplay needs to be fixed up to set SP and ControlPC to have the values for the current frame for which personality routine // is invoked. @@ -1421,7 +1423,6 @@ void ExceptionTracker::InitializeCrawlFrame(CrawlFrame* pcfThisFrame, Thread* pT // However, we do this *only* when "ControlPCForEHSearch" is the same as "DispatcherContext->ControlPC", // indicating we are not using the thread-abort reraise loop prevention logic. // - bool fAdjustRegdisplayControlPC = false; if (pDispatcherContext->ControlPc == ControlPCForEHSearch) { // Since DispatcherContext->ControlPc is used to initialize the @@ -1437,7 +1438,9 @@ void ExceptionTracker::InitializeCrawlFrame(CrawlFrame* pcfThisFrame, Thread* pT // Remove the Thumb bit ControlPCForEHSearch = ThumbCodeToDataPointer<DWORD_PTR, DWORD_PTR>(ControlPCForEHSearch); #endif +#endif // _TARGET_ARM_ || _TARGET_ARM64_ +#if defined(_TARGET_ARM_) || defined(_TARGET_ARM64_) || defined(_TARGET_X86_) // If the OS indicated that the IP is a callsite, then adjust the ControlPC by decrementing it // by two. This is done because unwinding at callsite will make ControlPC point to the // instruction post the callsite. If a protected region ends "at" the callsite, then @@ -1460,7 +1463,7 @@ void ExceptionTracker::InitializeCrawlFrame(CrawlFrame* pcfThisFrame, Thread* pT pcfThisFrame->isIPadjusted = true; } } -#endif // _TARGET_ARM_ || _TARGET_ARM64_ +#endif // _TARGET_ARM_ || _TARGET_ARM64_ || _TARGET_X86_ pcfThisFrame->codeInfo.Init(ControlPCForEHSearch); @@ -4337,7 +4340,7 @@ VOID UnwindManagedExceptionPass2(PAL_SEHException& ex, CONTEXT* unwindStartConte dispatcherContext.FunctionEntry = codeInfo.GetFunctionEntry(); dispatcherContext.ControlPc = controlPc; dispatcherContext.ImageBase = codeInfo.GetModuleBase(); -#if defined(_TARGET_ARM_) +#if defined(_TARGET_ARM_) || defined(_TARGET_X86_) dispatcherContext.ControlPcIsUnwound = !!(currentFrameContext->ContextFlags & CONTEXT_UNWOUND_TO_CALL); #endif // Check whether we have a function table entry for the current controlPC. @@ -4488,7 +4491,7 @@ VOID DECLSPEC_NORETURN UnwindManagedExceptionPass1(PAL_SEHException& ex, CONTEXT dispatcherContext.FunctionEntry = codeInfo.GetFunctionEntry(); dispatcherContext.ControlPc = controlPc; dispatcherContext.ImageBase = codeInfo.GetModuleBase(); -#if defined(_TARGET_ARM_) +#if defined(_TARGET_ARM_) || defined(_TARGET_X86_) dispatcherContext.ControlPcIsUnwound = !!(frameContext->ContextFlags & CONTEXT_UNWOUND_TO_CALL); #endif |