From aff4979e399adcadbba497a94c5d72cb918a2e24 Mon Sep 17 00:00:00 2001 From: Eva-Maria Behner Date: Fri, 5 Apr 2024 13:06:25 +0200 Subject: [PATCH] some minor fixes --- .../restructuring_commons/condition_based_refinement.py | 4 ++-- tests/structures/graphs/test_graph_interface.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/decompiler/pipeline/controlflowanalysis/restructuring_commons/condition_based_refinement.py b/decompiler/pipeline/controlflowanalysis/restructuring_commons/condition_based_refinement.py index ab28d995..cab42f43 100644 --- a/decompiler/pipeline/controlflowanalysis/restructuring_commons/condition_based_refinement.py +++ b/decompiler/pipeline/controlflowanalysis/restructuring_commons/condition_based_refinement.py @@ -160,7 +160,7 @@ def _remove_formulas(self, removing_formulas: Set[Formula]): symbols_of_formulas: Set[Symbol] = set() for formula in removing_formulas: self._logic_graph.remove_nodes_from(list(self._formula_graph.successors(formula))) - symbols_of_formulas.add(self._auxiliary_graph.successors(formula)) + symbols_of_formulas.update(self._auxiliary_graph.successors(formula)) self._remove_formula_node(formula) self._remove_symbols(set(symbol for symbol in symbols_of_formulas if self._symbol_only_in_one_formula(symbol))) @@ -191,7 +191,7 @@ def _remove_symbols(self, removing_symbols: Set[Symbol]): self._logic_graph.remove_nodes_from(removing_symbols) new_single_formula_nodes = set() for clause in clauses_containing_any_symbol: - symbols_of_clause = list(self._logic_graph.successors(clause)) + symbols_of_clause = list(self._formula_graph.successors(clause)) self._logic_graph.remove_node(clause) for clause_symbol in (s for s in symbols_of_clause if not has_path(self._formula_graph, clause.formula, s)): self._logic_graph.remove_edge(clause.formula, clause_symbol) diff --git a/tests/structures/graphs/test_graph_interface.py b/tests/structures/graphs/test_graph_interface.py index c8455aba..fbd10bc8 100644 --- a/tests/structures/graphs/test_graph_interface.py +++ b/tests/structures/graphs/test_graph_interface.py @@ -474,4 +474,4 @@ def test_contains(self): assert nodes[0] in graph assert not BasicNode(6) in graph assert edges[2] in graph - assert not BasicEdge(nodes[2], nodes[0]) in graph \ No newline at end of file + assert not BasicEdge(nodes[2], nodes[0]) in graph