Skip to content

Commit

Permalink
Fix pointer resize method
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Aug 14, 2024
1 parent df82b62 commit 51dee91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions decompiler/structures/pseudo/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ def __init__(self, basetype: Type, size: int = 32):
object.__setattr__(self, "type", basetype)
object.__setattr__(self, "size", size)

def resize(self, new_size: int) -> Pointer:
# Needs custom implementation, because construction parameter 'basetype' differs in name to field 'type'.
# This causes dataclasses.replace to not work
return Pointer(self.type, new_size)

def __str__(self) -> str:
"""Return a nice string representation."""
if isinstance(self.type, Pointer):
Expand Down

0 comments on commit 51dee91

Please sign in to comment.