diff --git a/src/coreclr/vm/excep.cpp b/src/coreclr/vm/excep.cpp index 46741b04604d01..1758528113b164 100644 --- a/src/coreclr/vm/excep.cpp +++ b/src/coreclr/vm/excep.cpp @@ -10330,6 +10330,20 @@ void SoftwareExceptionFrame::UpdateRegDisplay_Impl(const PREGDISPLAY pRD, bool u } #ifndef DACCESS_COMPILE + +void SoftwareExceptionFrame::SetContext(T_CONTEXT *pContext) +{ + LIMITED_METHOD_CONTRACT; + + m_Context = *pContext; + +#define CALLEE_SAVED_REGISTER(regname) m_ContextPointers.regname = &m_Context.regname; + ENUM_CALLEE_SAVED_REGISTERS(); +#undef CALLEE_SAVED_REGISTER + + m_ReturnAddress = ::GetIP(&m_Context); +} + #ifdef TARGET_X86 void SoftwareExceptionFrame::UpdateContextFromTransitionBlock(TransitionBlock *pTransitionBlock) diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp index cacb59ebe46d5b..dd6cfe57b315a1 100644 --- a/src/coreclr/vm/exceptionhandling.cpp +++ b/src/coreclr/vm/exceptionhandling.cpp @@ -663,8 +663,9 @@ ProcessCLRException(IN PEXCEPTION_RECORD pExceptionRecord, TADDR ssp = 0; #endif - ResumableFrame resFrame(pContextRecord); - resFrame.Push(pThread); + SoftwareExceptionFrame exceptionFrame; + exceptionFrame.SetContext(pContextRecord); + exceptionFrame.InitAndLink(pThread); OBJECTREF oref = ExInfo::CreateThrowable(pExceptionRecord, FALSE); INSTALL_RESUME_AFTER_CATCH_HANDLER_WITH_CONTEXT(pContextRecord, ssp); diff --git a/src/coreclr/vm/frames.h b/src/coreclr/vm/frames.h index b25ea276fb629d..dc1a954604369f 100644 --- a/src/coreclr/vm/frames.h +++ b/src/coreclr/vm/frames.h @@ -1061,6 +1061,7 @@ class SoftwareExceptionFrame : public Frame } void UpdateContextFromTransitionBlock(TransitionBlock *pTransitionBlock); + void SetContext(T_CONTEXT *pContext); #endif TADDR GetReturnAddressPtr_Impl()