Skip to content

Commit 699331b

Browse files
committed
convert_member_union now accepts union-typed operand
convert_member_union now accepts a union-typed compound operand, as opposed to requiring a union_tag type.
1 parent 50bfa4e commit 699331b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/solvers/flattening/boolbv_member.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ static bvt convert_member_union(
1818
const namespacet &ns)
1919
{
2020
const exprt &union_op = expr.compound();
21+
2122
const union_typet &union_op_type =
22-
ns.follow_tag(to_union_tag_type(union_op.type()));
23+
union_op.type().id() == ID_union_tag
24+
? ns.follow_tag(to_union_tag_type(union_op.type()))
25+
: to_union_type(union_op.type());
2326

2427
const irep_idt &component_name = expr.get_component_name();
2528
const union_typet::componentt &component =

0 commit comments

Comments
 (0)