Skip to content

Commit eac79ad

Browse files
committed
Fix floating point updating in resuming after catch
1 parent cfd1ca4 commit eac79ad

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/coreclr/vm/exceptionhandling.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,13 +1574,16 @@ VOID DECLSPEC_NORETURN RethrowResumeAfterCatchException(const ResumeAfterCatchEx
15741574
REGDISPLAY rd = {};
15751575
T_CONTEXT context = {};
15761576
#if (defined(HOST_WINDOWS) && defined(HOST_AMD64)) || defined(TARGET_ARM64)
1577+
constexpr BOOL updateFloats = TRUE;
15771578
context.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT;
1579+
RtlCaptureContext(&context);
15781580
#else
1581+
constexpr BOOL updateFloats = FALSE;
15791582
context.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
15801583
#endif
15811584

15821585
FillRegDisplay(&rd, &context);
1583-
pFrame->UpdateRegDisplay(&rd, FALSE /* updateFloats */);
1586+
pFrame->UpdateRegDisplay(&rd, updateFloats);
15841587

15851588
#if defined(HOST_WINDOWS) && defined(HOST_AMD64)
15861589
// Initialize FP control/status so that the context can be used for resuming execution

src/coreclr/vm/frames.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ void InlinedCallFrame::UpdateFloatingPointRegisters_Impl(const PREGDISPLAY pRD,
713713
BOOL InlinedCallFrame::IsInInterpreter()
714714
{
715715
PTR_InterpreterFrame pInterpreterFrame = NULL;
716-
if ((m_Next != FRAME_TOP) && (m_Next->GetFrameIdentifier() == FrameIdentifier::InterpreterFrame))
716+
if ((m_Next != FRAME_TOP) && (m_Next != NULL) && (m_Next->GetFrameIdentifier() == FrameIdentifier::InterpreterFrame))
717717
{
718718
PTR_InterpreterFrame pInterpreterFrame = (PTR_InterpreterFrame)m_Next;
719719
// The interpreter frame is in the interpreter when its top method context frame matches the m_pCallSiteSP

0 commit comments

Comments
 (0)