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

Fixed fuzz int overflow #2594

Merged
merged 2 commits into from
Aug 3, 2022
Merged

Fixed fuzz int overflow #2594

merged 2 commits into from
Aug 3, 2022

Conversation

alexeuler
Copy link
Contributor

Motivation

Fixes #2560

The problem was that generating random int relied on the overflow behavior for U256. I.e. it assumed that bits for U256 are just the bits of I256. This perfectly generates random I256. However it stops working when we generate I128 and use I256 for that. Because U128 is not overflown in I256.

@onbjerg onbjerg added the T-bug Type: bug label Aug 3, 2022
@onbjerg
Copy link
Member

onbjerg commented Aug 3, 2022

Awesome!!! For good measure, can we get a simple int128 test?

@gakonst
Copy link
Member

gakonst commented Aug 3, 2022

merging so it's fixed ASAP and let's do an extra test in follow up @alexeuler ?

@gakonst gakonst merged commit e5dc565 into foundry-rs:master Aug 3, 2022
@moose-code
Copy link

Epic thanks for fixing so quick legends!

iFrostizz pushed a commit to iFrostizz/foundry that referenced this pull request Nov 9, 2022
* fixed fuzz int overflow

* fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing forge-std fuzz I256 tests
4 participants