VirtualBox

Ignore:
Timestamp:
Oct 1, 2020 1:59:14 PM (4 years ago)
Author:
vboxsync
Message:

IPRT/RTStrToInt64Ex: Shut up tstRTCRest-1 asan warning reading INT64_MIN. bugref:9841

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/strtonum.cpp

    r82968 r86378  
    634634    }
    635635
    636     if (   !(u64 & RT_BIT_64(63))
    637         || (!fPositive && u64 == RT_BIT_64(63)) )
    638     { /* likely */ }
     636    /* Mixing pi64 assigning and overflow checks is to pacify a tstRTCRest-1
     637       asan overflow warning.  */
     638    if (!(u64 & RT_BIT_64(63)))
     639    {
     640        if (psz == pszValue)
     641            rc = VERR_NO_DIGITS;
     642        if (pi64)
     643            *pi64 = fPositive ? u64 : -(int64_t)u64;
     644    }
     645    else if (!fPositive && u64 == RT_BIT_64(63))
     646    {
     647        if (pi64)
     648            *pi64 = INT64_MIN;
     649    }
    639650    else
     651    {
    640652        rc = VWRN_NUMBER_TOO_BIG;
    641 
    642     if (pi64)
    643         *pi64 = fPositive ? u64 : -(int64_t)u64;
    644 
    645     if (psz == pszValue)
    646         rc = VERR_NO_DIGITS;
     653        if (pi64)
     654            *pi64 = fPositive ? u64 : -(int64_t)u64;
     655    }
    647656
    648657    if (ppszNext)
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