Skip to content

array arg clamps fix#2071

Merged
fubuloubu merged 3 commits into
vyperlang:masterfrom
iamdefinitelyahuman:arg-clamps-fix
Jun 30, 2020
Merged

array arg clamps fix#2071
fubuloubu merged 3 commits into
vyperlang:masterfrom
iamdefinitelyahuman:arg-clamps-fix

Conversation

@iamdefinitelyahuman

@iamdefinitelyahuman iamdefinitelyahuman commented Jun 29, 2020

Copy link
Copy Markdown
Contributor

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

Comment thread vyper/parser/arg_clamps.py
Comment thread vyper/parser/arg_clamps.py Outdated
@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