vyper Version (output of vyper --version OR linkable commit hash vyperlang/vyper@): vyperlang/vyper@b43fface148b45cbd2c90b5d24f77398a63745b5
Issue Description
_stack_peephole_opts() try to perform several optimizations as long as
i < len(assembly) - 2, however, the last two optimizations could, in
theory, be performed even if i == len(assembly) - 1 given that they
only access assembly[i] and assembly[i+1].
if (
isinstance(assembly[i], str)
and assembly[i].startswith("SWAP")
and assembly[i] == assembly[i + 1]
):
changed = True
del assembly[i : i + 2]
if assembly[i] == "SWAP1" and assembly[i + 1].lower() in COMMUTATIVE_OPS:
changed = True
del assembly[i]
Version Information
vyper --version
OR linkable commit hash vyperlang/vyper@Issue Description
_stack_peephole_opts()
try to perform several optimizations as long asi < len(assembly) - 2
, however, the last two optimizations could, in theory, be performed even ifi == len(assembly) - 1
given that they only accessassembly[i]
andassembly[i+1]
.