Commit 90c94281 authored by Igor Chorążewicz's avatar Igor Chorążewicz
Browse files

self_relative_ptr: fix UB when adding non-zero offset to possibly null pointer

Cast 'this' to integer type instead of casting to pointer type.

Original implementation resulted in the following error for
self_relative_ptr_atomic test:

"runtime error: pointer index expression with base 0x7ffc7773e7c0
overflowed to 0xfffffffffffffffe"
parent 21534230
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