未验证 提交 26a1c7e1 编写于 作者: V Vladimir Sadov 提交者: GitHub

Use CopyContext to restore saved context on X86 (#65490)

* Use CopyContext to restore saved context on X86

* PR feedback

* more PR feedback
上级 c80a3460
......@@ -2509,6 +2509,7 @@ void RedirectedThreadFrame::ExceptionUnwind()
#ifndef TARGET_UNIX
#ifdef TARGET_X86
//****************************************************************************************
// This will check who caused the exception. If it was caused by the the redirect function,
// the reason is to resume the thread back at the point it was redirected in the first
......@@ -2577,7 +2578,15 @@ int RedirectedHandledJITCaseExceptionFilter(
pFrame->Pop();
// Copy the saved context record into the EH context;
ReplaceExceptionContextRecord(pExcepPtrs->ContextRecord, pCtx);
// NB: cannot use ReplaceExceptionContextRecord here.
// these contexts may contain extended registers and may have different format
// for reasons such as alignment or context compaction
CONTEXT* pTarget = pExcepPtrs->ContextRecord;
if (!CopyContext(pTarget, pTarget->ContextFlags, pCtx))
{
STRESS_LOG1(LF_SYNC, LL_ERROR, "ERROR: Could not set context record, lastError = 0x%x\n", GetLastError());
EEPOLICY_HANDLE_FATAL_ERROR(COR_E_EXECUTIONENGINE);
}
DWORD espValue = pCtx->Esp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册