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 setbit/getbit bit offset out of range #164

Merged
merged 2 commits into from
Feb 2, 2021
Merged

Fix setbit/getbit bit offset out of range #164

merged 2 commits into from
Feb 2, 2021

Conversation

ShooterIT
Copy link
Member

For std::stoul, if arg is negative number, there is no exception, it will be very big number.
Why I limit the range into [0, INT_MAX] is that i found we get offset by std::stoi in msetbit/bitcount, do i miss somethings?

@git-hulk
Copy link
Member

git-hulk commented Feb 2, 2021

yeah, you're right that we should limit the range of the bit offset👍 . can you help to fix the lint error.

@git-hulk git-hulk self-requested a review February 2, 2021 09:02
@git-hulk git-hulk merged commit 5c60658 into apache:master Feb 2, 2021
@ShooterIT ShooterIT deleted the setbit-offset branch February 7, 2021 14:31
@ShooterIT ShooterIT mentioned this pull request Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants