VirtualBox

Ignore:
Timestamp:
Jul 12, 2018 9:06:33 PM (7 years ago)
Author:
vboxsync
Message:

*: Made RT_UOFFSETOF, RT_OFFSETOF, RT_UOFFSETOF_ADD and RT_OFFSETOF_ADD work like builtin_offsetof() and require compile time resolvable requests, adding RT_UOFFSETOF_DYN for the dynamic questions that can only be answered at runtime.

Location:
trunk/src/VBox/Runtime/r3/solaris
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp

    r69438 r73097  
    983983     * layout in the future. See @bugref{8479}.
    984984     */
    985     size_t const offZoneId = RT_OFFSETOF(psinfo_t, pr_zoneid);
     985    size_t const offZoneId = RT_UOFFSETOF(psinfo_t, pr_zoneid);
    986986    if (pSolProc->cbProcInfo < offZoneId)
    987987    {
     
    10351035    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
    10361036
    1037     size_t offLwp         = RT_OFFSETOF(psinfo_t, pr_lwp);
     1037    size_t offLwp         = RT_UOFFSETOF(psinfo_t, pr_lwp);
    10381038    /* last member we care about in lwpsinfo_t is pr_bindpset which is also present on ancient Solaris version we use for
    10391039       building the additions. Should be safe enough as we don't need/access members upto or beyond that point anyway. */
    1040     size_t offLastOnProc  = RT_OFFSETOF(lwpsinfo_t, pr_bindpset);
     1040    size_t offLastOnProc  = RT_UOFFSETOF(lwpsinfo_t, pr_bindpset);
    10411041    if (pSolProc->cbProcInfo >= offLwp + offLastOnProc)
    10421042    {
  • trunk/src/VBox/Runtime/r3/solaris/krnlmod-solaris.cpp

    r67304 r73097  
    9191    int rc = VINF_SUCCESS;
    9292    size_t cchName = strlen(&pModInfo->mi_name[0]) + 1;
    93     PRTKRNLMODINFOINT pThis = (PRTKRNLMODINFOINT)RTMemAllocZ(RT_OFFSETOF(RTKRNLMODINFOINT, achName[cchName]));
     93    PRTKRNLMODINFOINT pThis = (PRTKRNLMODINFOINT)RTMemAllocZ(RT_UOFFSETOF_DYN(RTKRNLMODINFOINT, achName[cchName]));
    9494    if (RT_LIKELY(pThis))
    9595    {
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