Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

UnboundLocalError: local variable 'args' referenced before assignment #24

Open
@0xNadr

Description

@0xNadr

Bytecode can be found here if you want to test it:
Download

For some bytecodes when I try to extract the CFG using:
python3 main.py -f bb.bin -g

I get the following error:

Traceback (most recent call last):
  File "/Users/nader/Desktop/octo/octopus/octopus/platforms/ETH/cfg.py", line 9, in __new__
    return EvmCFG(bytecode, analysis=evm_analysis)
  File "/Users/nader/Desktop/octo/octopus/octopus/arch/evm/cfg.py", line 160, in __init__
    self.run_dynamic_analysis()
  File "/Users/nader/Desktop/octo/octopus/octopus/arch/evm/cfg.py", line 173, in run_dynamic_analysis
    emul.emulate()
  File "/Users/nader/Desktop/octo/octopus/octopus/arch/evm/emulator.py", line 122, in emulate
    halt = self.emulate_one_instruction(instr, state, depth)
  File "/Users/nader/Desktop/octo/octopus/octopus/arch/evm/emulator.py", line 168, in emulate_one_instruction
    halt = self.ssa_stack_memory_storage_flow_instruction(instr, state, depth)
  File "/Users/nader/Desktop/octo/octopus/octopus/arch/evm/emulator.py", line 400, in ssa_stack_memory_storage_flow_instruction
    self.emulate(new_state, depth=depth + 1)
  File "/Users/nader/Desktop/octo/octopus/octopus/arch/evm/emulator.py", line 122, in emulate
    halt = self.emulate_one_instruction(instr, state, depth)
  File "/Users/nader/Desktop/octo/octopus/octopus/arch/evm/emulator.py", line 148, in emulate_one_instruction
    self.emul_comparaison_logic_instruction(instr, state)
  File "/Users/nader/Desktop/octo/octopus/octopus/arch/evm/emulator.py", line 261, in emul_comparaison_logic_instruction
    instr.name, args=args)
UnboundLocalError: local variable 'args' referenced before assignment

Anyone knows what might be the exact problem here?

I would gladly work on a fix for this if there is any guidance on how the emulator is working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions