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

[[email protected]:81] KeyError: TransitionBlock(-0x2, AST=var_0 = arg5) #298

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions decompiler/pipeline/ssa/phi_lifting.py
NeoQuix marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def _lift_phi_functions_of(self, basic_block: BasicBlock) -> None:
new_basic_block = self._insert_basic_block_before(basic_block, new_instructions)
if predecessor:
self._cfg.substitute_edge(edge, edge.copy(sink=new_basic_block))
else:
self._cfg.root = new_basic_block

self._update_interference_graph_after_lifting(new_instructions)

Expand Down
4 changes: 4 additions & 0 deletions tests/pipeline/SSA/test_out_of_ssa_phi_lifting.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ def test_lifting_phi_on_top_1(variable_v, variable_u):
and isinstance(phi_fct_lifter._cfg.get_edge(node, node), UnconditionalEdge)
and len(phi_fct_lifter._cfg.edges) == 2
)
# The root of the CFG must be updated by PhiFunctionLifter for the other stages to work
assert cfg.root == new_nodes[0]


def test_lifting_phi_on_top_2(variable_v, variable_u):
Expand Down Expand Up @@ -324,3 +326,5 @@ def test_lifting_phi_on_top_2(variable_v, variable_u):
and isinstance(phi_fct_lifter._cfg.get_edge(node, node), UnconditionalEdge)
and len(phi_fct_lifter._cfg.edges) == 2
)
# The root of the CFG must be updated by PhiFunctionLifter for the other stages to work
assert cfg.root == new_nodes[0]