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 promotion of negative isize #133

Merged
merged 2 commits into from
Jan 27, 2020
Merged

Fix promotion of negative isize #133

merged 2 commits into from
Jan 27, 2020

Conversation

HactarCE
Copy link
Contributor

This fixes #132.

@cuviper
Copy link
Member

cuviper commented Jan 25, 2020

Ouch, thank you for finding this! Your change looks good.

It looks like that was a copy-paste typo all the way back from #41. The tests added then only cover native BigInt ops, not mixed with primitives. For the non-assign ops we have scalar tests that try conversions with all of the primitive integers, so we maybe should expand that for assign ops too. Is that something you could try? We should at least get a regression test of some sort.

The master branch is currently in preparation for 0.3, but I think I will open a branch and release a new 0.2.x for this fix too.

@cuviper
Copy link
Member

cuviper commented Jan 27, 2020

I just added more scalar tests myself. They did fail before your fix, and pass now.

bors r+

bors bot added a commit that referenced this pull request Jan 27, 2020
133: Fix promotion of negative isize r=cuviper a=HactarCE

This fixes #132.

Co-authored-by: Hactar <6060305+HactarCE@users.noreply.github.com>
Co-authored-by: Josh Stone <cuviper@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jan 27, 2020

Build succeeded

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.

BigInt AddAssign<isize> with negative addend is off by 2^32 or 2^64
2 participants