VirtualBox

Changeset 97863 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Dec 23, 2022 5:01:49 PM (2 years ago)
Author:
vboxsync
Message:

IPRT/nocrt: Some _except_handler4 cleanups. bugref:10261 ticketref:21303

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/compiler/vcc/except-x86-vcc.cpp

    r97862 r97863  
    5555DECLASM(LONG)                   rtVccEh4DoFiltering(PFN_EH4_XCPT_FILTER_T pfnFilter, uint8_t const *pbFrame);
    5656DECLASM(DECL_NO_RETURN(void))   rtVccEh4JumpToHandler(PFN_EH4_XCPT_HANDLER_T pfnHandler, uint8_t const *pbFrame);
    57 //DECLASM(void)                   rtVccEh4DoLocalUnwind(PEXCEPTION_REGISTRATION_RECORD pXcptRegRec, uint32_t uTargetTryLevel,
    58 //                                                      uint8_t const *pbFrame, uintptr_t *pSecurityCookie);
    5957DECLASM(void)                   rtVccEh4DoGlobalUnwind(PEXCEPTION_RECORD pXcptRec, PEXCEPTION_REGISTRATION_RECORD pXcptRegRec);
    6058DECLASM(void)                   rtVccEh4DoFinally(PFN_EH4_FINALLY_T pfnFinally, bool fAbend, uint8_t const *pbFrame);
    6159
    6260
    63 static void rtVccEh4DoLocalUnwind(PEXCEPTION_REGISTRATION_RECORD pXcptRegRec, uint32_t uTargetTryLevel,
    64                                   uint8_t const *pbFrame, uintptr_t *pSecurityCookie)
     61/**
     62 * Calls the __finally blocks up to @a uTargetTryLevel is reached, starting with
     63 * @a pEh4XcptRegRec->uTryLevel.
     64 *
     65 * @param   pEh4XcptRegRec  The EH4 exception registration record.
     66 * @param   uTargetTryLevel The target __try level to stop unwinding at.
     67 * @param   pbFrame         The frame pointer (EBP).
     68 */
     69static void rtVccEh4DoLocalUnwind(PEH4_XCPT_REG_REC_T pEh4XcptRegRec, uint32_t uTargetTryLevel, uint8_t const *pbFrame)
    6570{
    6671    /*
     
    7277     * Do the unwinding.
    7378     */
    74     PEH4_XCPT_REG_REC_T pEh4XcptRegRec = RT_FROM_MEMBER(pXcptRegRec, EH4_XCPT_REG_REC_T, XcptRec);
    75     uint32_t            uCurTryLevel   = pEh4XcptRegRec->uTryLevel;
     79    uint32_t uCurTryLevel = pEh4XcptRegRec->uTryLevel;
    7680    while (   uCurTryLevel != EH4_TOPMOST_TRY_LEVEL
    7781           && (   uCurTryLevel > uTargetTryLevel
    7882               || uTargetTryLevel == EH4_TOPMOST_TRY_LEVEL /* if we knew what 0xffffffff meant, this could probably be omitted */ ))
    7983    {
    80         PCEH4_SCOPE_TAB_T const pScopeTable = (PCEH4_SCOPE_TAB_T)(pEh4XcptRegRec->uEncodedScopeTable ^ *pSecurityCookie);
     84        PCEH4_SCOPE_TAB_T const pScopeTable = (PCEH4_SCOPE_TAB_T)(pEh4XcptRegRec->uEncodedScopeTable ^ __security_cookie);
    8185        PCEH4_SCOPE_TAB_REC_T const pEntry  = &pScopeTable->aScopeRecords[uCurTryLevel];
    8286
     
    108112
    109113
     114/**
     115 * Helper that validates stack cookies.
     116 */
    110117DECLINLINE(void) rtVccEh4ValidateCookies(PCEH4_SCOPE_TAB_T pScopeTable, uint8_t const *pbFrame)
    111118{
     
    198205                    {
    199206                        //RTAssertMsg2("_except_handler4: local unwind\n");
    200                         rtVccEh4DoLocalUnwind(&pEh4XcptRegRec->XcptRec, uTryLevel, pbFrame, &__security_cookie);
     207                        rtVccEh4DoLocalUnwind(pEh4XcptRegRec, uTryLevel, pbFrame);
    201208                    }
    202209                    rtVccEh4ValidateCookies(pScopeTable, pbFrame);
     
    226233        if (pEh4XcptRegRec->uTryLevel != EH4_TOPMOST_TRY_LEVEL)
    227234        {
    228             rtVccEh4DoLocalUnwind(&pEh4XcptRegRec->XcptRec, EH4_TOPMOST_TRY_LEVEL, pbFrame, &__security_cookie);
     235            rtVccEh4DoLocalUnwind(pEh4XcptRegRec, EH4_TOPMOST_TRY_LEVEL, pbFrame);
    229236            rtVccEh4ValidateCookies(pScopeTable, pbFrame);
    230237        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette