0x7CFE / llst

LLVM powered Little Smalltalk.
Other
93 stars 10 forks source link

Bit shifting of negative integers leads to undefined behavior #54

Open 0x7CFE opened 10 years ago

0x7CFE commented 10 years ago

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.