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

Overflow prepare compiler #7262

Merged

Conversation

bcardiff
Copy link
Member

@bcardiff bcardiff commented Jan 3, 2019

The PR updates the stdlib to use unchecked operations & conversions where needed.
It's easier to review per commit than per changes.

compiler_specs need to use &+ rather than + or including prelude would be required.
The to_X! operations are used when calling libs instead of to_X.

If the last value was 1 << 31 an overflow would be thrown.
This is not changing the current behavior.
The Enum flags with UInt64 base type work only if the values are explicit.
Otherwise OverflowError and raise method will need to be defined
end
else
counter + 1
counter &+ 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An issue to fix or discuss this behaviour should be created.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done at #7268. Is there any other feedback of the changes of the PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the PR is good! Thanks!

@RX14 RX14 merged commit a0cbc9d into crystal-lang:master Jan 5, 2019
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