Skip to content

Commit 31b4b1b

Browse files
committed
Byte extract lowering of unions: convert width to bytes
The upper bound for lowering a union to a sequence of bytes is the byte-width of the widest member, not the bit width.
1 parent 5c5e43e commit 31b4b1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/lower_byte_operators.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ static exprt unpack_rec(
943943
member,
944944
little_endian,
945945
offset_bytes,
946-
widest_member->second,
946+
(widest_member->second + bits_per_byte - 1) / bits_per_byte,
947947
bits_per_byte,
948948
ns,
949949
true);

0 commit comments

Comments
 (0)