From 3677bfc79e764f68302491120737117de78673e4 Mon Sep 17 00:00:00 2001 From: Eva-Maria Behner Date: Wed, 13 Mar 2024 10:11:17 +0100 Subject: [PATCH] minor remarks --- .../restructuring_commons/condition_based_refinement.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/decompiler/pipeline/controlflowanalysis/restructuring_commons/condition_based_refinement.py b/decompiler/pipeline/controlflowanalysis/restructuring_commons/condition_based_refinement.py index 9f68f194b..76a724bb9 100644 --- a/decompiler/pipeline/controlflowanalysis/restructuring_commons/condition_based_refinement.py +++ b/decompiler/pipeline/controlflowanalysis/restructuring_commons/condition_based_refinement.py @@ -69,7 +69,7 @@ def get_next_subexpression(self): yield child, LogicCondition.conjunction_of(new_operands) if child not in self._candidates or current_size > self._max_subexpression_size: break - self._max_subexpression_size -= 1 + self._max_subexpression_size = current_size - 1 def remove(self, nodes_to_remove: List[AbstractSyntaxTreeNode]): for node in nodes_to_remove: @@ -237,7 +237,9 @@ def _is_subexpression_of_cnf_formula(self, term: LogicCondition, expression: Log return False subexpressions = [term] if numb_of_arg_term == 1 else term_operands - expression_operands = (expression & term).operands + # Not sure whether we not want first the expression and then the term, since we do the same when inserting the condition-node. + # However, we could compare which operands are removed, and then decide whether this is something we want. + expression_operands = (term & expression).operands return all(self._is_contained_in_logic_conditions(sub_expr, expression_operands) for sub_expr in subexpressions) @staticmethod