Skip to content

Commit 6f38516

Browse files
Daniel Kroeningthk123
Daniel Kroening
authored and
thk123
committed
expr_initializert: fix type of enum constants
1 parent 18cb59a commit 6f38516

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/util/expr_initializer.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,13 @@ exprt expr_initializert<nondet>::expr_initializer_rec(
270270
}
271271
else if(type_id==ID_c_enum_tag)
272272
{
273-
return
274-
expr_initializer_rec(
275-
ns.follow_tag(to_c_enum_tag_type(type)),
276-
source_location);
273+
exprt result = expr_initializer_rec(
274+
ns.follow_tag(to_c_enum_tag_type(type)), source_location);
275+
276+
// use the tag type
277+
result.type() = type;
278+
279+
return result;
277280
}
278281
else if(type_id==ID_struct_tag)
279282
{

0 commit comments

Comments
 (0)