Skip to content

Commit 536b087

Browse files
author
Daniel Kroening
committed
simplify_exprt::expr2bits now independent of bitvector representation
1 parent d8236d3 commit 536b087

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util/simplify_expr.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,9 @@ optionalt<std::string> simplify_exprt::expr2bits(
15751575
type.id()==ID_floatbv ||
15761576
type.id()==ID_fixedbv)
15771577
{
1578-
std::string nat=id2string(to_constant_expr(expr).get_value());
1578+
const auto width = to_bitvector_type(type).get_width();
1579+
mp_integer int_value=bv2integer(id2string(to_constant_expr(expr).get_value()), width, false);
1580+
std::string nat=integer2binary(int_value, width);
15791581
std::reverse(nat.begin(), nat.end());
15801582

15811583
endianness_mapt map(type, little_endian, ns);

0 commit comments

Comments
 (0)