Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions src/coreclr/vm/excep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7360,6 +7360,12 @@ VOID DECLSPEC_NORETURN UnwindAndContinueRethrowHelperAfterCatch(Frame* pEntryFra
}
else
{
#ifdef FEATURE_INTERPRETER
if ((pEntryFrame != FRAME_TOP) && (pEntryFrame->GetFrameIdentifier() == FrameIdentifier::InterpreterFrame))
{
((InterpreterFrame*)pEntryFrame)->SetIsFaulting(true);
}
#endif // FEATURE_INTERPRETER
DispatchManagedException(orThrowable);
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/vm/frames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,11 @@ void InterpreterFrame::SetContextToInterpMethodContextFrame(T_CONTEXT * pContext
SetSP(pContext, dac_cast<TADDR>(pFrame));
SetFP(pContext, (TADDR)pFrame->pStack);
SetFirstArgReg(pContext, dac_cast<TADDR>(this));
pContext->ContextFlags = CONTEXT_FULL;
if (m_isFaulting)
{
pContext->ContextFlags |= CONTEXT_EXCEPTION_ACTIVE;
}
}

void InterpreterFrame::UpdateRegDisplay_Impl(const PREGDISPLAY pRD, bool updateFloats)
Expand Down
11 changes: 10 additions & 1 deletion src/coreclr/vm/frames.h
Original file line number Diff line number Diff line change
Expand Up @@ -2417,7 +2417,8 @@ class InterpreterFrame : public FramedMethodFrame
#ifndef DACCESS_COMPILE
InterpreterFrame(TransitionBlock* pTransitionBlock, InterpMethodContextFrame* pContextFrame)
: FramedMethodFrame(FrameIdentifier::InterpreterFrame, pTransitionBlock, NULL),
m_pTopInterpMethodContextFrame(pContextFrame)
m_pTopInterpMethodContextFrame(pContextFrame),
m_isFaulting(false)
#if defined(HOST_AMD64) && defined(HOST_WINDOWS)
, m_SSP(0)
#endif
Expand Down Expand Up @@ -2471,10 +2472,18 @@ class InterpreterFrame : public FramedMethodFrame
}
#endif // HOST_AMD64 && HOST_WINDOWS

void SetIsFaulting(bool isFaulting)
{
LIMITED_METHOD_CONTRACT;
m_isFaulting = isFaulting;
}

private:
// The last known topmost interpreter frame in the InterpExecMethod belonging to
// this InterpreterFrame.
PTR_InterpMethodContextFrame m_pTopInterpMethodContextFrame;
// Set to true to indicate that the topmost interpreted frame has thrown an exception
bool m_isFaulting;
#if defined(HOST_AMD64) && defined(HOST_WINDOWS)
// Saved SSP of the InterpExecMethod for resuming after catch into interpreter frames.
TADDR m_SSP;
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/vm/interpexec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,12 +1737,14 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
{
throwable = LOCAL_VAR(ip[1], OBJECTREF);
}
pInterpreterFrame->SetIsFaulting(true);
DispatchManagedException(throwable);
UNREACHABLE();
break;
}
case INTOP_RETHROW:
{
pInterpreterFrame->SetIsFaulting(true);
DispatchRethrownManagedException();
UNREACHABLE();
break;
Expand Down Expand Up @@ -2220,6 +2222,8 @@ do { \
pMethod = pFrame->startIp->Method;
assert(pMethod->CheckIntegrity());
pThreadContext->pStackPointer = pFrame->pStack + pMethod->allocaSize;

pInterpreterFrame->SetIsFaulting(false);
goto MAIN_LOOP;
}

Expand Down
6 changes: 5 additions & 1 deletion src/coreclr/vm/stackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2860,8 +2860,12 @@ void StackFrameIterator::ProcessCurrentFrame(void)
m_interpExecMethodFirstArgReg = (TADDR)GetFirstArgReg(pRD->pCurrentContext);

((PTR_InterpreterFrame)m_crawl.pFrame)->SetContextToInterpMethodContextFrame(pRD->pCurrentContext);
if (pRD->pCurrentContext->ContextFlags & CONTEXT_EXCEPTION_ACTIVE)
{
m_crawl.isInterrupted = true;
m_crawl.hasFaulted = true;
}

pRD->pCurrentContext->ContextFlags = CONTEXT_FULL;
SyncRegDisplayToCurrentContext(pRD);
ProcessIp(GetControlPC(pRD));
m_walkingInterpreterFrames = m_crawl.isFrameless;
Expand Down
Loading