From 0a41de02d27174ecb9d2f6ae439267b9428f04ea Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Tue, 14 Feb 2023 15:57:07 -0500 Subject: Fix crash from creating 0 width enum --- python/types.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python/types.py') 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) -- cgit v1.3.1