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

ARMDisassembler.c:491:19: runtime error: left shift of 225 by 24 places cannot be represented in type 'int' #994

Closed
XVilka opened this issue Aug 17, 2017 · 4 comments · Fixed by #1949

Comments

@XVilka
Copy link
Contributor

XVilka commented Aug 17, 2017

arch/ARM/ARMDisassembler.c:491:19: runtime error: left shift of 225 by 24 places cannot be represented in type 'int'

@aquynh
Copy link
Collaborator

aquynh commented Aug 17, 2017

please provide branch info.

@XVilka
Copy link
Contributor Author

XVilka commented Aug 18, 2017

It's 'next' branch obviously, see also

'SStream.c:110:4: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself'

@10110111
Copy link
Contributor

10110111 commented Sep 2, 2017

This is indeed present in current next branch. The problem is that code is uint8_t*, so its elements, before being shifted, are promoted to int (not to unsigned int!) due to integer promotion rules of the C language. They should be casted to an unsigned before shifting.

@aquynh
Copy link
Collaborator

aquynh commented Sep 6, 2017

can anybody send a pull req?

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

Successfully merging a pull request may close this issue.

3 participants