Skip to content
Open
10 changes: 10 additions & 0 deletions src/coreclr/vm/exceptionhandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down