File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
regression/goto-instrument/dump-enum Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 22main.c
33--dump-c
44enum hex \{ .* \};
5+ h=/\*enum\*/V10;
56^EXIT=0$
67^SIGNAL=0$
78--
Original file line number Diff line number Diff line change @@ -1709,24 +1709,21 @@ std::string expr2ct::convert_constant(
17091709 if (c_enum_type.id ()!=ID_c_enum)
17101710 return convert_norep (src, precedence);
17111711
1712- const bool is_signed = c_enum_type.subtype ().id () == ID_signedbv;
1713- const auto width = to_bitvector_type (c_enum_type.subtype ()).get_width ();
1714-
1715- mp_integer int_value = bvrep2integer (value, width, is_signed);
1716- mp_integer i=0 ;
1717-
1718- irep_idt int_value_string=integer2string (int_value);
1719-
17201712 const c_enum_typet::memberst &members=
17211713 to_c_enum_type (c_enum_type).members ();
17221714
17231715 for (const auto &member : members)
17241716 {
1725- if (member.get_value () == int_value_string )
1717+ if (member.get_value () == value )
17261718 return " /*enum*/" + id2string (member.get_base_name ());
17271719 }
17281720
17291721 // failed...
1722+ const bool is_signed = c_enum_type.subtype ().id () == ID_signedbv;
1723+ const auto width = to_bitvector_type (c_enum_type.subtype ()).get_width ();
1724+
1725+ mp_integer int_value = bvrep2integer (value, width, is_signed);
1726+
17301727 return " /*enum*/" +integer2string (int_value);
17311728 }
17321729 else if (type.id ()==ID_rational)
You can’t perform that action at this time.
0 commit comments