Skip to content

Add overflow checking on LiteralExpression #860

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

Merged
merged 1 commit into from
Jan 7, 2022
Merged

Conversation

philberty
Copy link
Member

This checks that the literal value is within the bounds of their respective
types. I have omitted code fixing the other issue in the bug report that
overflow/max_val integers should be saturated to infinity when cast to
REAL_TYPE's this seems like something we really should have documentation
to reference in the code as to why this is the correct Rust behaviour.

Addresses #635

@philberty philberty added the bug label Jan 5, 2022
@philberty philberty added this to the Macro Expansion milestone Jan 5, 2022
@philberty philberty requested review from dkm and dafaust January 5, 2022 18:33
@philberty philberty self-assigned this Jan 5, 2022
@philberty philberty force-pushed the phil/literal-overflows branch from 2cfa11b to 4caa204 Compare January 5, 2022 20:54
@philberty philberty requested a review from tschwinge January 5, 2022 20:57
This checks that the literal value is within the bounds of their respective
types. I have ommited code fixing the other issue in the bug report that
overflow/max_val integers should be saturated to infinity when cast to
REAL_TYPE's this seems like something we really should have documentation
to reference in the code as to why this is the correct Rust behaviour.

Addresses #635
@philberty philberty force-pushed the phil/literal-overflows branch from 4caa204 to 507dbac Compare January 6, 2022 10:48
@philberty
Copy link
Member Author

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 7, 2022

Build succeeded:

@bors bors bot merged commit 03e56b5 into master Jan 7, 2022
@philberty philberty deleted the phil/literal-overflows branch January 11, 2022 11:24
@philberty philberty linked an issue Jan 17, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use references to get the HIR::Literal on HIR::LiteralExpr's
1 participant