Repository: dotnet/runtime
File: src/coreclr/vm/exceptionhandling.cpp (C++)

Code before:
        }

        if ((GetRegdisplaySP(pFrameIter->m_crawl.GetRegisterSet()) == handlingFrameSP)
#if TARGET_ARM64
            && (GetControlPC(pFrameIter->m_crawl.GetRegisterSet()) == handlingFramePC)
#endif  
            )
        {
            // invoke only a partial second-pass here...
            InvokeSecondPass(pExInfo, startIdx, catchingTryRegionIdx);
            break;
        }

        InvokeSecondPass(pExInfo, startIdx);
    }

    // ------------------------------------------------
    //
    // Call the handler and resume execution
    //
    // ------------------------------------------------
    pExInfo->m_idxCurClause = catchingTryRegionIdx;

    CallCatchFunclet(pExInfo->m_exception, (BYTE *)pCatchHandler, pFrameIter->m_crawl.GetRegisterSet(), pExInfo);
    // CallCatchFunclet will resume after the catch and never return here.
    //UNREACHABLE();
}

//
// This function continues exception interception unwind after it crossed native frames using
// standard EH / SEH.
//
VOID DECLSPEC_NORETURN ContinueExceptionInterceptionUnwind()
{
    STATIC_CONTRACT_THROWS;
    STATIC_CONTRACT_GC_TRIGGERS;
    STATIC_CONTRACT_MODE_ANY;

    Thread*               pThread  = GetThread();
    ThreadExceptionState* pExState = pThread->GetExceptionState();

    UINT_PTR uInterceptStackFrame  = 0;

    pExState->GetDebuggerState()->GetDebuggerInterceptInfo(NULL, NULL,
                                                           (PBYTE*)&uInterceptStackFrame,
                                                           NULL, NULL);


    GCX_COOP();

    ExInfo* pExInfo = (ExInfo*)pExState->GetCurrentExceptionTracker();

Review comment (suggestion):
The commented-out UNREACHABLE() should be removed rather than left as a comment. Since this PR is specifically about removing NORETURN markings and UNREACHABLE() calls due to the compiler optimization issue, leaving this commented out is inconsistent with the other changes.
```suggestion

```

Code after:
        {
            _ASSERTE_MSG(GetRegdisplaySP(pFrameIter->m_crawl.GetRegisterSet()) == handlingFrameSP, "Encountered a different reverse P/Invoke frame in the second pass.");
            // Found the native frame that called the reverse P/invoke.
            // It is not possible to run managed second pass handlers on a native frame.
            break;
        }

        if ((GetRegdisplaySP(pFrameIter->m_crawl.GetRegisterSet()) == handlingFrameSP)
#if TARGET_ARM64
            && (GetControlPC(pFrameIter->m_crawl.GetRegisterSet()) == handlingFramePC)
#endif  
            )
        {
            // invoke only a partial second-pass here...
            InvokeSecondPass(pExInfo, startIdx, catchingTryRegionIdx);
            break;
        }

        InvokeSecondPass(pExInfo, startIdx);
    }

    // ------------------------------------------------
    //
    // Call the handler and resume execution
    //
    // ------------------------------------------------
    pExInfo->m_idxCurClause = catchingTryRegionIdx;

    CallCatchFunclet(pExInfo->m_exception, (BYTE *)pCatchHandler, pFrameIter->m_crawl.GetRegisterSet(), pExInfo);
    // CallCatchFunclet will resume after the catch and never return here.
    UNREACHABLE();
}

//
// This function continues exception interception unwind after it crossed native frames using
// standard EH / SEH.
//
VOID DECLSPEC_NORETURN ContinueExceptionInterceptionUnwind()
{
    STATIC_CONTRACT_THROWS;
    STATIC_CONTRACT_GC_TRIGGERS;
    STATIC_CONTRACT_MODE_ANY;

    Thread*               pThread  = GetThread();
    ThreadExceptionState* pExState = pThread->GetExceptionState();

    UINT_PTR uInterceptStackFrame  = 0;

    pExState->GetDebuggerState()->GetDebuggerInterceptInfo(NULL, NULL,
                                                           (PBYTE*)&uInterceptStackFrame,
                                                           NULL, NULL);