Skip to content

Overflow prepare compiler#7262

Merged
RX14 merged 5 commits intocrystal-lang:masterfrom
bcardiff:feature/overflow-prepare-compiler
Jan 5, 2019
Merged

Overflow prepare compiler#7262
RX14 merged 5 commits intocrystal-lang:masterfrom
bcardiff:feature/overflow-prepare-compiler

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
Member

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
Member

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