VirtualBox

Changeset 99131 in vbox for trunk/include


Ignore:
Timestamp:
Mar 23, 2023 8:50:34 AM (21 months ago)
Author:
vboxsync
Message:

include/iprt/asm.h: Revert r156471 and replace the buggy AssertStmt() with an AssertRelease() to fend off unaligned accesses

File:
1 edited

Legend:

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

    r99106 r99131  
    68196819
    68206820# else
    6821     int32_t offBitmap = iBit >> 3;
    6822     rc.u32 = ASMAtomicUoReadU8(&((uint8_t volatile *)pvBitmap)[offBitmap]) >> (iBit & 7);
     6821    int32_t offBitmap = iBit / 32;
     6822    AssertRelease(!((uintptr_t)pvBitmap & (sizeof(uintptr_t) - 1))); /* This assumes a power of two uintptr_t size. */
     6823    rc.u32 = RT_LE2H_U32(ASMAtomicUoReadU32(&((uint32_t volatile *)pvBitmap)[offBitmap])) >> (iBit & 31);
    68236824    rc.u32 &= 1;
    68246825# 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