llst icon indicating copy to clipboard operation
llst copied to clipboard

Bit shifting of negative integers leads to undefined behavior

Open 0x7CFE opened this issue 11 years ago • 0 comments

Accoring to the article “Wade not in unknown waters. Part three” we may not perform a bit shift of negative integers. Still, we need to do it when converting from negative SmallInt value to it's pointer representation.

We need to provide a workaround that will eliminate possible UB and not corrupt the value's sign.

0x7CFE avatar Jan 17 '14 10:01 0x7CFE