File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -291,17 +291,23 @@ exprt expr_initializert<nondet>::expr_initializer_rec(
291291 }
292292 else if (type_id==ID_struct_tag)
293293 {
294- return
295- expr_initializer_rec (
296- ns.follow_tag (to_struct_tag_type (type)),
297- source_location);
294+ exprt result = expr_initializer_rec (
295+ ns.follow_tag (to_struct_tag_type (type)), source_location);
296+
297+ // use the tag type
298+ result.type () = type;
299+
300+ return result;
298301 }
299302 else if (type_id==ID_union_tag)
300303 {
301- return
302- expr_initializer_rec (
303- ns.follow_tag (to_union_tag_type (type)),
304- source_location);
304+ exprt result = expr_initializer_rec (
305+ ns.follow_tag (to_union_tag_type (type)), source_location);
306+
307+ // use the tag type
308+ result.type () = type;
309+
310+ return result;
305311 }
306312 else if (type_id==ID_string)
307313 {
You can’t perform that action at this time.
0 commit comments