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

Simplifying BufLength via bufLength #414

Merged
merged 2 commits into from
Oct 20, 2023
Merged

Conversation

msooseth
Copy link
Collaborator

Description

We accidentally removed(?) or never added(?) the bufLength call to simplify BufLength. Discovered this while writing a concrete fuzzer of Expr. This is a pretty funny one I think! :D Added a unit test to make sure we catch this next time!

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@@ -282,7 +282,12 @@ tests = testGroup "hevm"
]
, testGroup "SimplifierUnitTests"
-- common overflow cases that the simplifier was getting wrong
[ testCase "writeWord-overflow" $ do
[ testCase "bufLength-simp" $ do
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would adding tests for more complicated buffer expressions (the involve writes perhaps to abstract buffers) make sense?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably :) I wanted to keep this PR short and sweet. I didn't want to dig myself into bufLength -- it may be perfect, it may be possible to improve. I just wanted to make sure it's actually working and used 😄

Should we write a few more test cases? Perhaps that could be an issue I can tackle in another PR. I don't want to delay this PR too long. What do you think?

Copy link
Collaborator

@zoep zoep left a comment

Choose a reason for hiding this comment

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

Nice catch!

I think it would be nice to add more tests for bufLength, but maybe it is also testsed by the fuzzer?

@msooseth msooseth merged commit a82924f into main Oct 20, 2023
@msooseth
Copy link
Collaborator Author

I'll add some more tests for other functionalities of bufLength in another PR :)

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