Skip to content

Replace use of deprecated nil_typet in c_bit_field_replacement_type [blocks: #3800] #3945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions src/solvers/flattening/c_bit_field_replacement_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Author: Daniel Kroening, [email protected]

\*******************************************************************/


#include "c_bit_field_replacement_type.h"

#include <util/invariant.h>

typet c_bit_field_replacement_type(
const c_bit_field_typet &src,
const namespacet &ns)
Expand All @@ -23,21 +24,18 @@ typet c_bit_field_replacement_type(
result.set_width(src.get_width());
return std::move(result);
}
else if(subtype.id()==ID_c_enum_tag)
else
{
PRECONDITION(subtype.id() == ID_c_enum_tag);

const typet &sub_subtype=
ns.follow_tag(to_c_enum_tag_type(subtype)).subtype();

if(sub_subtype.id()==ID_signedbv ||
sub_subtype.id()==ID_unsignedbv)
{
bitvector_typet result=to_bitvector_type(sub_subtype);
result.set_width(src.get_width());
return std::move(result);
}
else
return nil_typet();
PRECONDITION(
sub_subtype.id() == ID_signedbv || sub_subtype.id() == ID_unsignedbv);

bitvector_typet result = to_bitvector_type(sub_subtype);
result.set_width(src.get_width());
return std::move(result);
}
else
return nil_typet();
}