From 83252d9a8b594a5ff1c19fb829ddcf2e1a308985 Mon Sep 17 00:00:00 2001 From: rihi <19492038+rihi@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:36:23 +0200 Subject: [PATCH] Catch empty operands operation in collapse_constants.py --- .../expression_simplification/rules/collapse_constants.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/decompiler/pipeline/controlflowanalysis/expression_simplification/rules/collapse_constants.py b/decompiler/pipeline/controlflowanalysis/expression_simplification/rules/collapse_constants.py index a940a6863..b32a84215 100644 --- a/decompiler/pipeline/controlflowanalysis/expression_simplification/rules/collapse_constants.py +++ b/decompiler/pipeline/controlflowanalysis/expression_simplification/rules/collapse_constants.py @@ -14,6 +14,8 @@ class CollapseConstants(SimplificationRule): """ def apply(self, operation: Operation) -> list[tuple[Expression, Expression]]: + if not operation.operands: + return [] # Is this even allowed? if not all(isinstance(o, Constant) for o in operation.operands): return []