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

Fix no overflow check when primitive int converts to same type #11003

Conversation

HertzDevil
Copy link
Contributor

The expression 1.to_i32 is apparently not a no-op, at least in non-release mode, as it requires a definition of __crystal_raise_overflow. This PR fixes that.

The same is already done for primitive floats converting to their own types.

@straight-shoota straight-shoota added this to the 1.2.0 milestone Jul 24, 2021
@straight-shoota straight-shoota changed the title Don't check for overflow when primitive integer conversion produces same type Fix no overflow check when primitive int converts to same type Jul 27, 2021
@straight-shoota straight-shoota merged commit 3cc36c9 into crystal-lang:master Jul 27, 2021
@HertzDevil HertzDevil deleted the perf/int-same-type-overflow-check branch July 27, 2021 11:13
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