summaryrefslogtreecommitdiff
path: root/python/types.py
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2023-02-14 15:57:07 -0500
committerJosh Ferrell <josh@vector35.com>2023-02-14 15:57:07 -0500
commit0a41de02d27174ecb9d2f6ae439267b9428f04ea (patch)
tree2076140ac1131c8bd817c1bd9c999df12d83842b /python/types.py
parentda48fde5958ad3eedcd3c4b82d7dc5b9428c9e93 (diff)
Fix crash from creating 0 width enum
Diffstat (limited to 'python/types.py')
-rw-r--r--python/types.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/types.py b/python/types.py
index 3be51744..0acbdf55 100644
--- a/python/types.py
+++ b/python/types.py
@@ -1378,9 +1378,11 @@ class EnumerationBuilder(TypeBuilder):
if members is None:
members = []
- _width = width
- if width is None:
+
+ if width is None or width == 0:
_width = 4 if arch is None else arch.default_int_size
+ else:
+ _width = width
_sign = BoolWithConfidence.get_core_struct(sign)