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

array arg clamps fix #2071

Merged
merged 3 commits into from
Jun 30, 2020
Merged

Conversation

iamdefinitelyahuman
Copy link
Contributor

@iamdefinitelyahuman iamdefinitelyahuman commented Jun 29, 2020

What I did

Adjust logic for args clamper when dealing with arrays.

Fixes #2003

How I did it

  • Instead of recursively looping through each array within a multidimensional array, we immediately determine the base type and then check each item within the array.
  • If the base type does not require clamping, don't loop

How to verify it

Run tests. I wasn't able to find many tests around arg clamping so I wrote some to test the entire behavior.

Cute Animal Picture

image

vyper/parser/arg_clamps.py Show resolved Hide resolved
vyper/parser/arg_clamps.py Outdated Show resolved Hide resolved
@iamdefinitelyahuman iamdefinitelyahuman marked this pull request as ready for review June 30, 2020 10:15
@fubuloubu fubuloubu merged commit bd8e0d3 into vyperlang:master Jun 30, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the arg-clamps-fix branch June 30, 2020 14:10
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.

Infinite loop from multidimensional array in calldata
2 participants