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

[crt] fix shift out of type bounds #7733

Merged
merged 2 commits into from
Mar 31, 2021
Merged

[crt] fix shift out of type bounds #7733

merged 2 commits into from
Mar 31, 2021

Conversation

rafzi
Copy link
Contributor

@rafzi rafzi commented Mar 24, 2021

When running with "-fsanitize=undefined" I got the following error:

tvm/src/runtime/crt/common/crt_runtime_api.c:213:32: runtime error: left shift of 32770 by 16 places cannot be represented in type 'int'

The expression "module_index | 0x8000" is of type "int" and needs to be casted to unsigned before the shift.

@areusch

When running with "-fsanitize=undefined" I got the following error:

    tvm/src/runtime/crt/common/crt_runtime_api.c:213:32: runtime error: left shift of 32770 by 16 places cannot be represented in type 'int'

The expression "module_index | 0x8000" is of type "int" and needs to be casted to unsigned before the shift.
@areusch
Copy link
Contributor

areusch commented Mar 24, 2021

thanks @rafzi, this change looks good to me. can you retrigger the CI by adding an empty commit? looks like it got stuck on task_rust.

@tqchen tqchen merged commit 6eedad1 into apache:main Mar 31, 2021
@tqchen
Copy link
Member

tqchen commented Mar 31, 2021

Thanks @rafzi @areusch !

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* [crt] fix shift out of type bounds
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* [crt] fix shift out of type bounds
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* [crt] fix shift out of type bounds
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
* [crt] fix shift out of type bounds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants