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

Wrong type of e1 << e2 #13

Closed
rillig opened this issue Apr 14, 2019 · 1 comment
Closed

Wrong type of e1 << e2 #13

rillig opened this issue Apr 14, 2019 · 1 comment

Comments

@rillig
Copy link

rillig commented Apr 14, 2019

https://stackoverflow.com/questions/55673029/does-a-c-shift-expression-have-unsigned-type

It's a bug in Splint. Splint wrongly assumes that the type of e1 << e2 is ctype_wider(te1, te2). The correct type would be just te1.

The buggy code starts here by using the same code path for the bitwise operators like &, | and ^, as well as for the << and >> operators.

The actual bug is at the end of that code, which assumes that for all these bitwise binary operators, the return type is ctype_wider(te1, te2).

@bpringlemeir
Copy link
Collaborator

Fixed by 5201227

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

No branches or pull requests

2 participants