peristent_ptr: change ptr_offset_magic to be properly aligned
Casting unaligned ptr_offset_magic address to pointers is undefined behavior for types which require alignemnt > 1. It results in following error under UBSAN for ptr_0_none test: "runtime error: upcast of misaligned address 0x0000deadbeef for type 'C', which requires 8 byte alignment" Also, add test for offset calculation for objects with different alignment requirements.
parent
dc5348d5
Please register or sign in to comment