We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec8b34d commit 6dfb412Copy full SHA for 6dfb412
src/solvers/flattening/boolbv_constant.cpp
@@ -78,19 +78,12 @@ bvt boolbvt::convert_constant(const constant_exprt &expr)
78
expr_type.id()==ID_c_bit_field ||
79
expr_type.id()==ID_incomplete_c_enum)
80
{
81
- const std::string &binary=id2string(expr.get_value());
82
-
83
- if(binary.size()!=width)
84
- {
85
- error().source_location=expr.find_source_location();
86
- error() << "wrong value length in constant: "
87
- << expr.pretty() << eom;
88
- throw 0;
89
- }
+ auto value = bv2integer(id2string(expr.get_value()), false);
90
91
for(std::size_t i=0; i<width; i++)
92
93
- bool bit=(binary[binary.size()-i-1]=='1');
+ const bool bit=value.is_odd();
+ value/=2;
94
bv[i]=const_literal(bit);
95
}
96
0 commit comments