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 Time::Span initializer from big seconds and sleep with big seconds #7221

Merged
merged 2 commits into from
Dec 27, 2018

Conversation

asterite
Copy link
Member

@asterite asterite commented Dec 27, 2018

Fixes #7220

The two commits are self-descriptive. In the first case it was silently overflowing because the to_i64 was applied too late. In the second case an incorrect to_i call was used when casting to TimeT should have been used.

I think in both cases this would have been caught by an overflow error in the overflow branch (but I didn't try it).

(I don't think there's a way to test sleep, so no tests for that)

@asterite asterite force-pushed the bug/time-span-seconds-too-big branch from 3294a23 to ca3452b Compare December 27, 2018 14:01
@bcardiff bcardiff added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:time labels Dec 27, 2018
@bcardiff bcardiff added this to the 0.27.1 milestone Dec 27, 2018
@bcardiff bcardiff merged commit dd40c17 into crystal-lang:master Dec 27, 2018
@asterite asterite deleted the bug/time-span-seconds-too-big branch March 30, 2019 16:36
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:stdlib:time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants