Commit 1c37736e authored by Igor Chorążewicz's avatar Igor Chorążewicz
Browse files

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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment