Skip to content

Commit 9904695

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 f513331 commit 9904695

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/lower_byte_operators.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ static exprt unpack_rec(
935935
member,
936936
little_endian,
937937
offset_bytes,
938-
widest_member->second,
938+
(widest_member->second + bits_per_byte - 1) / bits_per_byte,
939939
bits_per_byte,
940940
ns,
941941
true);

0 commit comments

Comments
 (0)