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 interpreter internal overflow for UInt128#to_f32 and #to_f32! #14437

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Apr 5, 2024

Makes code like UInt128::MAX.to_f32 raise OverflowError in the interpreted code, not in the interpreter itself. Also makes UInt128::MAX.to_f32! not raise any OverflowError.

This was discovered by running spec/primitives/int_spec.cr with the interpreter.

@HertzDevil HertzDevil added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:numeric topic:compiler:interpreter labels Apr 5, 2024
@HertzDevil HertzDevil changed the title Fix internal overflow for UInt128#to_f32 in the interpreter Fix internal overflow for UInt128#to_f32 and #to_f32! in the interpreter Apr 5, 2024
@HertzDevil HertzDevil changed the title Fix internal overflow for UInt128#to_f32 and #to_f32! in the interpreter Fix interpreter internal overflow for UInt128#to_f32 and #to_f32! Apr 5, 2024
@straight-shoota straight-shoota added this to the 1.12.0 milestone Apr 6, 2024
@straight-shoota straight-shoota merged commit 39253d0 into crystal-lang:master Apr 8, 2024
58 checks passed
@HertzDevil HertzDevil deleted the bug/interpreter-u128-to-f32-overflow branch April 8, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:interpreter topic:stdlib:numeric
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants