Skip to content

Commit d4e1f52

Browse files
committed
Clarify CopyContext in RedirectedHandledJITCaseExceptionFilter
1 parent de51359 commit d4e1f52

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/coreclr/vm/threadsuspend.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,12 +2551,12 @@ int RedirectedHandledJITCaseExceptionFilter(
25512551
// Unlink the frame in preparation for resuming in managed code
25522552
pFrame->Pop();
25532553

2554-
// Copy the saved context record into the EH context;
2555-
// NB: cannot use ReplaceExceptionContextRecord here.
2556-
// these contexts may contain extended registers and may have different format
2557-
// for reasons such as alignment or context compaction
2554+
// Copy everything in the saved context record into the EH context.
2555+
// Historically the EH context has enough space for every enabled context feature.
2556+
// That may not hold for the future features beyond AVX, but this codepath is
2557+
// supposed to be used only on OSes that do not have RtlRestoreContext.
25582558
CONTEXT* pTarget = pExcepPtrs->ContextRecord;
2559-
if (!CopyContext(pTarget, pTarget->ContextFlags, pCtx))
2559+
if (!CopyContext(pTarget, pCtx->ContextFlags, pCtx))
25602560
{
25612561
STRESS_LOG1(LF_SYNC, LL_ERROR, "ERROR: Could not set context record, lastError = 0x%x\n", GetLastError());
25622562
EEPOLICY_HANDLE_FATAL_ERROR(COR_E_EXECUTIONENGINE);

0 commit comments

Comments
 (0)