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

Bug with functions that pass through stack values #4

Open
meyer9 opened this issue Oct 8, 2017 · 0 comments
Open

Bug with functions that pass through stack values #4

meyer9 opened this issue Oct 8, 2017 · 0 comments
Labels

Comments

@meyer9
Copy link
Owner

meyer9 commented Oct 8, 2017

Bytecode to reproduce:

600160025b5b01

Disassembled bytecode:

; Procedure 0x0
[     0x0] | PUSH1                | [1]
[     0x2] | PUSH1                | [2]

; Procedure 0x4
[     0x4] | JUMPDEST             | None

; Procedure 0x5
[     0x5] | JUMPDEST             | None
[     0x6] | ADD                  | None

Error:

Traceback (most recent call last):
  File "ethdasm.py", line 18, in <module>
    blocks = contract.parse()
  File "/Users/jmeyer2k/development/ethdasm/ethdasm/contract.py", line 328, in parse
    self.__add_final_functions()
  File "/Users/jmeyer2k/development/ethdasm/ethdasm/contract.py", line 272, in __add_final_functions
    arguments.append(block.return_vals[i])
IndexError: list index out of range

The problem here is that the ending function for the second block actually requires arguments to be passed through. It might need to add arguments to the previous function if the next function requires more values than the block puts on the stack.

Also, a problem arises when now we need to update the previous block to take in a certain number of parameters.

This bug will require some serious thinking.

@meyer9 meyer9 added the bug label Oct 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant