Skip to content

Commit 3ff9bbe

Browse files
author
Daniel Kroening
committed
expr_initializert: fix type of enum constants
1 parent 0f7a99d commit 3ff9bbe

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/util/expr_initializer.cpp

Lines changed: 7 additions & 4 deletions
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)