diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp index 6473f4d069958c..46e9c78631c35c 100644 --- a/src/coreclr/vm/exceptionhandling.cpp +++ b/src/coreclr/vm/exceptionhandling.cpp @@ -4035,6 +4035,16 @@ CLR_BOOL SfiNextWorker(StackFrameIterator* pThis, uint* uExCollideClauseIdx, CLR } } + // Advance past the native marker frame to the explicit frame (e.g. FuncEvalFrame), + // but only when there is one. When pFrame is FRAME_TOP (e.g. foreign-thread reverse + // PInvoke with no further managed frames), there is no explicit frame to advance to. + if (pFrame != FRAME_TOP) + { + _ASSERTE(pThis->GetFrameState() == StackFrameIterator::SFITER_NATIVE_MARKER_FRAME); + pThis->Next(); + _ASSERTE(pThis->GetFrameState() == StackFrameIterator::SFITER_FRAME_FUNCTION); + } + *pfIsExceptionIntercepted = FALSE; if (fUnwoundReversePInvoke)