We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
repeat
If the #iteration of repeat loop is less than or equal to 0, it replaces it by 2, which perhaps should not, while 1 would be more reasonable: https://github.com/ethereum/viper/blob/b1fe12ddd8706ef3340a103916e3d3f2cc95ceef/viper/compile_lll.py#L96
2
1
Fortunately, for now, the repeat loops will be rejected in the preprocess phase if the #iteration is less than or equal to 0, but it would be good to fix for later: https://github.com/ethereum/viper/blob/b1fe12ddd8706ef3340a103916e3d3f2cc95ceef/viper/parser/parser_utils.py#L113-L114
Change the following line: https://github.com/ethereum/viper/blob/b1fe12ddd8706ef3340a103916e3d3f2cc95ceef/viper/compile_lll.py#L96 to something like:
loops = num_to_bytearray(code.args[2].value) or [1]
or
loops = num_to_bytearray(code.args[2].value) or raise Exception(...)
_.-.. ,'9 )\)`-.,.--. `-.| `. \, , \) `. )._\ (\ |// `-,// ]|| //" hjw "" ""
The text was updated successfully, but these errors were encountered:
Merge pull request #461 from DavidKnott/fix-for-loop
0cbbf7a
Fix issue #451: buggy translation of `repeat` when #iteration <= 0
No branches or pull requests
What's your issue about?
If the #iteration of
repeat
loop is less than or equal to 0, it replaces it by2
, which perhaps should not, while1
would be more reasonable:https://github.com/ethereum/viper/blob/b1fe12ddd8706ef3340a103916e3d3f2cc95ceef/viper/compile_lll.py#L96
Fortunately, for now, the
repeat
loops will be rejected in the preprocess phase if the #iteration is less than or equal to 0, but it would be good to fix for later:https://github.com/ethereum/viper/blob/b1fe12ddd8706ef3340a103916e3d3f2cc95ceef/viper/parser/parser_utils.py#L113-L114
How can it be fixed?
Change the following line:
https://github.com/ethereum/viper/blob/b1fe12ddd8706ef3340a103916e3d3f2cc95ceef/viper/compile_lll.py#L96
to something like:
or
Cute Animal Picture
The text was updated successfully, but these errors were encountered: