Skip to content

Commit

Permalink
Using instruction to synthesize when computing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcere committed Nov 20, 2024
1 parent 7310ec5 commit ac6d933
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/parser/cfg_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ def _build_spec_for_sequence(self, instructions: List[CFGInstruction], map_instr
unprocessed_instr = None

for i, ins in enumerate(instructions):
print(i, ins)

# Check if it has been already created
if ins.get_op_name().startswith("push"):
Expand Down Expand Up @@ -642,7 +643,7 @@ def build_spec(self, initial_stack: List[str], final_stack: List[str]) -> Dict[s
with open("sms.json", 'w') as f:
json.dump(spec, f, indent=4)

sto_deps, mem_deps = self._process_dependences(self._instructions, map_positions)
sto_deps, mem_deps = self._process_dependences(self.instructions_to_synthesize, map_positions)
spec["storage_dependences"] = sto_deps
spec["memory_dependences"] = mem_deps

Expand Down
2 changes: 1 addition & 1 deletion src/parser/utils_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def replace_pos_instrsid(dependences: List[Tuple[int, int]], map_positions_instr
deps = []
for (i, j) in dependences:
assert (i in map_positions_instructions) and (j in map_positions_instructions), \
"[ERROR]: position not found in map of instructions when genereting the dependences"
f"[ERROR]: position not found in map of instructions when genereting the dependences {i} {j}"
deps.append((map_positions_instructions[i], map_positions_instructions[j]))

return deps
Expand Down

0 comments on commit ac6d933

Please sign in to comment.