You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, Emboss uses read-modify-write (RMW) for any values inside bits, which means that writing to a field within bits can cause undefined behavior (UB) if the underlying buffer was not initialized.
It should be possible, at least on Clang, GCC, and MSVC, to write through a (C++) bitfield without doing the RMW at the C++ level, and therefore avoiding UB.
Note that the exact layout of C++ bitfields is implementation-defined, and there are also potential issues with strict aliasing violations, but for specific compilers it should be doable.
The text was updated successfully, but these errors were encountered:
Right now, Emboss uses read-modify-write (RMW) for any values inside
bits
, which means that writing to a field withinbits
can cause undefined behavior (UB) if the underlying buffer was not initialized.It should be possible, at least on Clang, GCC, and MSVC, to write through a (C++) bitfield without doing the RMW at the C++ level, and therefore avoiding UB.
Note that the exact layout of C++ bitfields is implementation-defined, and there are also potential issues with strict aliasing violations, but for specific compilers it should be doable.
The text was updated successfully, but these errors were encountered: