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 bit_length() method to work with zero-valued mpz integer. #4845

Merged
merged 2 commits into from
Jun 2, 2021

Conversation

t-ikegami
Copy link

The following code crashes CircuitPython 6.2 (tested on Wio Terminal) :

a = 10**10
a *= 0
a.bit_length()

This PR fixes the problem.

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit a25872d into adafruit:main Jun 2, 2021
kbsriram added a commit to kbsriram/circuitpython that referenced this pull request Feb 18, 2024
Also verified the tests fail without the fix in adafruit#4845
Fixes adafruit#4846
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.

None yet

3 participants