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

Missing Continue in Assembly Optimizations #4113

Open
ritzdorf opened this issue Apr 25, 2024 · 0 comments
Open

Missing Continue in Assembly Optimizations #4113

ritzdorf opened this issue Apr 25, 2024 · 0 comments

Comments

@ritzdorf
Copy link
Contributor

Version Information

  • vyper Version (output of vyper --version OR linkable commit hash vyperlang/vyper@): b43ffac

Issue Description

_stack_peephole_opts() tries to perform 5 different optimizations at
each index i of the assembly using a while loop. However, the last two
optimizations, when performed do not continue the loop, which means
that:

  • i is incremented by 1, leading to skipping the next instruction
    and potentially missing an optimization.
  • If both optimizations are performed for a given i, it might be
    that the second one tries accessing an index that is out of range
    given that the first one removed the 2 last elements of the array
    and the check for the index is not performed in between the two
    optimizations.
@cyberthirst cyberthirst transferred this issue from another repository Jun 10, 2024
@cyberthirst cyberthirst transferred this issue from another repository Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant