Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix GC stress C - wrong context being restored
The context that is restored in the PAL_DispatchException needs to be
the one from the exception, not the original saved one. That ensures
that the registers updated by the GC in GC stress C in the context
are properly restored after the execution is resumed.
  • Loading branch information
janvorli authored and github-actions committed Jan 25, 2022
commit 1d1bdacb116d3a0743d5dcf22fc8c76c5aa5168f
4 changes: 2 additions & 2 deletions src/coreclr/pal/src/exception/machexception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ void PAL_DispatchException(PCONTEXT pContext, PEXCEPTION_RECORD pExRecord, MachE
#if defined(HOST_ARM64)
// RtlRestoreContext assembly corrupts X16 & X17, so it cannot be
// used for GCStress=C restore
MachSetThreadContext(pContext);
MachSetThreadContext(exception.ExceptionPointers.ContextRecord);
#else
RtlRestoreContext(pContext, pExRecord);
RtlRestoreContext(exception.ExceptionPointers.ContextRecord, pExRecord);
#endif
}

Expand Down