From 800f20d72c94a7e69b542540b40c853975842b07 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Fri, 21 Jan 2022 15:50:25 -0500 Subject: Fix Variable.__hash__ and fix some Type APIs --- python/types.py | 4 ++-- python/variable.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/types.py b/python/types.py index 3d48afc2..4af5d856 100644 --- a/python/types.py +++ b/python/types.py @@ -1195,7 +1195,7 @@ class StructureBuilder(TypeBuilder): @dataclass(frozen=True) class EnumerationMember: name:str - value:Optional[int] + value:Optional[int] = None def __repr__(self): value = f"{self.value:#x}" if self.value is not None else "auto()" @@ -1359,7 +1359,7 @@ class NamedTypeReferenceBuilder(TypeBuilder): type_id:Optional[str]=None, name:QualifiedName=QualifiedName(""), width:int=0, align:int=1, platform:'_platform.Platform'=None, confidence:int=core.max_confidence, const:BoolWithConfidenceType=False, volatile:BoolWithConfidenceType=False) -> 'NamedTypeReferenceBuilder': - ntr_builder_handle = core.BNCreateNamedTypeBuilder(type_class, type_id, name._to_core_struct()) + ntr_builder_handle = core.BNCreateNamedTypeBuilder(type_class, type_id, QualifiedName(name)._to_core_struct()) assert ntr_builder_handle is not None, "core.BNCreateNamedTypeBuilder returned None" _const = BoolWithConfidence.get_core_struct(const) diff --git a/python/variable.py b/python/variable.py index 3862d95b..67dc2cac 100644 --- a/python/variable.py +++ b/python/variable.py @@ -694,7 +694,7 @@ class Variable(CoreVariable): return super().__ge__(other) and self._function >= other._function def __hash__(self): - return hash((self._function, super())) + return hash((self._function, super().__hash__())) @property def core_variable(self) -> CoreVariable: -- cgit v1.3.1