diff options
| author | Peter LaFosse <peter@vector35.com> | 2022-01-21 15:50:25 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2022-01-24 14:32:16 -0500 |
| commit | 800f20d72c94a7e69b542540b40c853975842b07 (patch) | |
| tree | f51142f82336f0ca87d1c57db1e9e465efb9bce7 /python | |
| parent | ba7e8e2b2b9d6e97de4cb99c4e810c65b49ce408 (diff) | |
Fix Variable.__hash__ and fix some Type APIs
Diffstat (limited to 'python')
| -rw-r--r-- | python/types.py | 4 | ||||
| -rw-r--r-- | python/variable.py | 2 |
2 files changed, 3 insertions, 3 deletions
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: |
