From 346df6fdb06f93a460450299e996c6ba467b4193 Mon Sep 17 00:00:00 2001 From: Manuel Blatt Date: Tue, 20 Aug 2024 14:36:56 +0200 Subject: [PATCH] shallow copy structs and arrays --- decompiler/structures/pseudo/expressions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/decompiler/structures/pseudo/expressions.py b/decompiler/structures/pseudo/expressions.py index 9f17d6d5..cdf91b2d 100644 --- a/decompiler/structures/pseudo/expressions.py +++ b/decompiler/structures/pseudo/expressions.py @@ -582,7 +582,7 @@ def __str__(self) -> str: def copy(self) -> ConstantComposition: """Generate a copy of the UnknownExpression with the same message.""" - return ConstantComposition([x.copy() for x in self.value], self._type.copy()) + return ConstantComposition(self.value, self._type) def accept(self, visitor: DataflowObjectVisitorInterface[T]) -> T: """Invoke the appropriate visitor for this Expression.""" @@ -617,4 +617,4 @@ def __iter__(self) -> Iterator[Expression]: def copy(self) -> StructConstant: """Generate a copy of the UnknownExpression with the same message.""" - return StructConstant(self.value.copy(), self._type.copy()) # Deep copy needed for all Expr inside. + return StructConstant(self.value, self._type)