diff --git a/slither/slithir/operations/assignment.py b/slither/slithir/operations/assignment.py index 5bedf2c856..1f29ceb7b1 100644 --- a/slither/slithir/operations/assignment.py +++ b/slither/slithir/operations/assignment.py @@ -50,5 +50,5 @@ def __str__(self) -> str: points = lvalue.points_to while isinstance(points, ReferenceVariable): points = points.points_to - return f"{lvalue} (->{points}) := {self.rvalue}({self.rvalue.type})" + return f"{lvalue}({lvalue.type}) (->{points}) := {self.rvalue}({self.rvalue.type})" return f"{lvalue}({lvalue.type}) := {self.rvalue}({self.rvalue.type})" diff --git a/slither/slithir/operations/new_array.py b/slither/slithir/operations/new_array.py index 8dad8532f7..34e8f99f7b 100644 --- a/slither/slithir/operations/new_array.py +++ b/slither/slithir/operations/new_array.py @@ -38,4 +38,7 @@ def depth(self) -> int: def __str__(self): args = [str(a) for a in self.arguments] - return f"{self.lvalue} = new {self.array_type}{'[]' * self.depth}({','.join(args)})" + lvalue = self.lvalue + return ( + f"{lvalue}({lvalue.type}) = new {self.array_type}{'[]' * self.depth}({','.join(args)})" + ) diff --git a/slither/slithir/operations/new_contract.py b/slither/slithir/operations/new_contract.py index 10fa91efd4..518a097cb5 100644 --- a/slither/slithir/operations/new_contract.py +++ b/slither/slithir/operations/new_contract.py @@ -104,4 +104,5 @@ def __str__(self) -> str: if self.call_salt: options += f"salt:{self.call_salt} " args = [str(a) for a in self.arguments] - return f"{self.lvalue} = new {self.contract_name}({','.join(args)}) {options}" + lvalue = self.lvalue + return f"{lvalue}({lvalue.type}) = new {self.contract_name}({','.join(args)}) {options}" diff --git a/slither/slithir/operations/new_structure.py b/slither/slithir/operations/new_structure.py index f24b3bccd9..c50cd6a3e0 100644 --- a/slither/slithir/operations/new_structure.py +++ b/slither/slithir/operations/new_structure.py @@ -39,4 +39,5 @@ def structure_name(self): def __str__(self): args = [str(a) for a in self.arguments] - return f"{self.lvalue} = new {self.structure_name}({','.join(args)})" + lvalue = self.lvalue + return f"{lvalue}({lvalue.type}) = new {self.structure_name}({','.join(args)})"