From 1feaa21612ea79f76082b8d2a0989c70bb59530c Mon Sep 17 00:00:00 2001 From: Manuel Blatt Date: Fri, 5 Jul 2024 11:47:42 +0200 Subject: [PATCH] fix StructConstant's hash --- decompiler/structures/pseudo/expressions.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/decompiler/structures/pseudo/expressions.py b/decompiler/structures/pseudo/expressions.py index 913a3019d..e1f03e8ff 100644 --- a/decompiler/structures/pseudo/expressions.py +++ b/decompiler/structures/pseudo/expressions.py @@ -596,8 +596,15 @@ def __init__(self, value: dict[int, Expression], vartype: Struct, tags: Optional tags, ) + def __eq__(self, __value): + return isinstance(__value, StructConstant) and super().__eq__(__value) + + def __hash__(self): + return hash(tuple(self.value.items())) + def __str__(self) -> str: """Return a string representation of the ConstantComposition""" + # TODO: return f"to_fix_struct_repr." def __iter__(self) -> Iterator[Expression]: