Skip to content

Commit 6dd3d3c

Browse files
author
Daniel Kroening
committed
replace_symbolt can now replace tag type symbols
1 parent ebf5ce8 commit 6dd3d3c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/util/replace_symbol.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,19 @@ bool replace_symbolt::replace(typet &dest) const
181181
if(!replace(p))
182182
result=false;
183183
}
184+
else if(dest.id() == ID_union_tag ||
185+
dest.id() == ID_struct_tag ||
186+
dest.id() == ID_c_enum_tag)
187+
{
188+
type_mapt::const_iterator it =
189+
type_map.find(to_tag_type(dest).get_identifier());
190+
191+
if(it != type_map.end())
192+
{
193+
dest = it->second;
194+
result = false;
195+
}
196+
}
184197
else if(dest.id()==ID_array)
185198
{
186199
array_typet &array_type=to_array_type(dest);

0 commit comments

Comments
 (0)