Skip to content

Commit

Permalink
allow trailing pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jul 13, 2023
1 parent 1e4dfa7 commit e1bf01b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vyper/compiler/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ def _build_opcodes(bytecode: bytes) -> str:
# we can have push_len > len(bytecode_sequence) when there is data
# (instead of code) at end of contract
# CMC 2023-07-13 maybe just strip known data segments?
if push_len <= len(bytecode_sequence):
push_values = [hex(bytecode_sequence.popleft())[2:] for i in range(push_len)]
opcode_output.append(f"0x{''.join(push_values).upper()}")
push_len = min(push_len, len(bytecode_sequence))
push_values = [hex(bytecode_sequence.popleft())[2:] for i in range(push_len)]
opcode_output.append(f"0x{''.join(push_values).upper()}")

return " ".join(opcode_output)

0 comments on commit e1bf01b

Please sign in to comment.