Skip to content

Commit

Permalink
Make sure replaced instructions are added after phi instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Feb 8, 2024
1 parent 96eadd7 commit 1bfe6dd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions decompiler/pipeline/commons/expressionpropagationcommons.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ def _remove_redundant_phis(self, graph: ControlFlowGraph) -> bool:
if not all_equal(instruction.value.operands):
continue

basic_block.replace_instruction(
instruction,
Assignment(instruction.destination, instruction.value.operands[0])
)
basic_block.remove_instruction(index)
basic_block.add_instruction_where_possible(Assignment(instruction.destination, instruction.value.operands[0]))
changes |= True
return changes

Expand Down

0 comments on commit 1bfe6dd

Please sign in to comment.