Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bit shifting of negative integers leads to undefined behavior #54

Open
0x7CFE opened this issue Jan 17, 2014 · 0 comments
Open

Bit shifting of negative integers leads to undefined behavior #54

0x7CFE opened this issue Jan 17, 2014 · 0 comments
Labels
Milestone

Comments

@0x7CFE
Copy link
Owner

0x7CFE commented Jan 17, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant