VirtualBox

Changeset 99106 in vbox for trunk


Ignore:
Timestamp:
Mar 22, 2023 8:50:27 AM (22 months ago)
Author:
vboxsync
Message:

include/iprt/asm.h: Fix ASMBitTest on arm64. Despite being buggy due to offBitmap being miscalculated on the misaligned case it won't work with passed memory regions not aligned on a 32-bit boundary because it will always load a 32-bit of data, possibly exceeding the end of the buffer. This fixes the tstRTGetOptArgv testcase on darwin.arm64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm.h

    r98103 r99106  
    68196819
    68206820# else
    6821     int32_t offBitmap = iBit / 32;
    6822     AssertStmt(!((uintptr_t)pvBitmap & 3), offBitmap += (uintptr_t)pvBitmap & 3; iBit += ((uintptr_t)pvBitmap & 3) * 8);
    6823     rc.u32 = RT_LE2H_U32(ASMAtomicUoReadU32(&((uint32_t volatile *)pvBitmap)[offBitmap])) >> (iBit & 31);
     6821    int32_t offBitmap = iBit >> 3;
     6822    rc.u32 = ASMAtomicUoReadU8(&((uint8_t volatile *)pvBitmap)[offBitmap]) >> (iBit & 7);
    68246823    rc.u32 &= 1;
    68256824# endif
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