hdl.ast: fix Const.cast(Cat(...)) handling for signed numbers.

This commit is contained in:
Wanda 2023-12-30 12:09:28 +01:00 committed by Catherine
parent 82d35fb932
commit 6780c838b2
2 changed files with 12 additions and 1 deletions

View file

@ -727,7 +727,8 @@ class Const(Value):
width = 0
for part in obj.parts:
const = Const.cast(part)
value |= const.value << width
part_value = Const(const.value, unsigned(const.width)).value
value |= part_value << width
width += len(const)
return Const(value, width)
else: