Skip to content

Commit

Permalink
fixing minor
Browse files Browse the repository at this point in the history
  • Loading branch information
tutugordillo committed Oct 21, 2024
1 parent cb60011 commit c5d64de
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/solution_generation/reconstruct_bytecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from global_params.types import SMS_T, ASM_bytecode_T, ASM_contract_T
from parser.cfg import CFG
from parser.cfg_block import CFGBlock
from pathlib import Path

# Solution ids to EVM assembly

Expand Down Expand Up @@ -104,7 +105,7 @@ def generate_asm_split_blocks(init_block_id, blocks, asm_dicts):

#Split instruction contains both jumps and not handled instructions
if block.split_instruction != None:
asm_last = asm_for_split_instruction_block(block)
asm_last = asm_for_split_instruction(block)
else:
asm_last = []

Expand Down Expand Up @@ -256,3 +257,9 @@ def asm_from_cfg(cfg: CFG, asm_dicts: Dict[str, List[ASM_bytecode_T]], tags_dict
json_object[filename + ":" +obj_name] = json_asm

return json_object


def store_asm_output(asm_output_dir:Path , json_object: Dict[str,Any], object_name: str):
file_to_store = asm_output_dir.joinpath(object_name + "_asm.json")
with open(file_to_store, 'w') as f:
json.dump(json_object, f, indent=4)

0 comments on commit c5d64de

Please sign in to comment.