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 BitShift::shl overflows #190

Merged

Conversation

maciejka
Copy link
Contributor

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Current implementation will return in premature overflows, for example: BitShift::shl(255_u8, 1) results in u8_mul Overflow while it should just return 254.

Issue Number: N/A

What is the new behavior?

BitShift::shl(255_u8, 1) == 254 etc

Does this introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Collaborator

@gaetbout gaetbout left a comment

Choose a reason for hiding this comment

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

Well done!

@0xLucqs 0xLucqs merged commit 3356bf0 into keep-starknet-strange:main Oct 11, 2023
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants