Skip to content

Commit b7b8db2

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 7eb77a8 commit b7b8db2

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
@@ -979,7 +979,7 @@ static exprt unpack_rec(
979979
member,
980980
little_endian,
981981
offset_bytes,
982-
widest_member->second,
982+
(widest_member->second + bits_per_byte - 1) / bits_per_byte,
983983
bits_per_byte,
984984
ns,
985985
true);

0 commit comments

Comments
 (0)