Closed GhisCo closed 4 years ago
Thanks! This currently works as expected on the platforms we support (only x86-64), but it's indeed non-standard, so I switched to memcpy
. The generated code is still basically the same. The changes are in the devel
branch.
Thanks for the prompt feedback & handling!
Hi, At runtime, UB-sanitizer reported a "load of misaligned address 0x**** for type 'unsigned short', which requires 2 byte alignment" in tza.cpp on `(T*)ptr`:
Indeed, if I understand https://stackoverflow.com/questions/47619944/load-of-misaligned-address-and-ubsan-finding correctly, the correct way to read the value would be to use
memcpy
, which is guaranteed by the standard to work even on misaligned addresses (because it must have the same effect as copying a series of individual bytes):Regards,