File tree 2 files changed +2
-6
lines changed 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -1111,10 +1111,8 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr)
1111
1111
if (base_type_eq (c.type (), op.type (), *this ))
1112
1112
{
1113
1113
// found! build union constructor
1114
- union_exprt union_expr (expr.type ());
1114
+ union_exprt union_expr (c. get_name (), op, expr.type ());
1115
1115
union_expr.add_source_location ()=expr.source_location ();
1116
- union_expr.op ()=op;
1117
- union_expr.set_component_name (c.get_name ());
1118
1116
expr=union_expr;
1119
1117
expr.set (ID_C_lvalue, true );
1120
1118
return ;
Original file line number Diff line number Diff line change @@ -219,8 +219,6 @@ exprt expr_initializert<nondet>::expr_initializer_rec(
219
219
const union_typet::componentst &components=
220
220
to_union_type (type).components ();
221
221
222
- union_exprt value (type);
223
-
224
222
union_typet::componentt component;
225
223
bool found=false ;
226
224
mp_integer component_size=0 ;
@@ -243,12 +241,12 @@ exprt expr_initializert<nondet>::expr_initializer_rec(
243
241
}
244
242
}
245
243
244
+ union_exprt value (" " , nil_exprt (), type);
246
245
value.add_source_location ()=source_location;
247
246
248
247
if (!found)
249
248
{
250
249
// stupid empty union
251
- value.op ()=nil_exprt ();
252
250
}
253
251
else
254
252
{
You can’t perform that action at this time.
0 commit comments