Skip to content

Commit a9f2e52

Browse files
author
Daniel Kroening
committed
boolbvt::bv_get_rec is now independent of bitvector representation
1 parent 68c728a commit a9f2e52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/solvers/flattening/boolbv_get.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ exprt boolbvt::bv_get_rec(
215215
}
216216
}
217217

218+
// most significant bit first
218219
std::string value;
219220

220221
for(std::size_t bit_nr=offset; bit_nr<offset+width; bit_nr++)
@@ -263,7 +264,7 @@ exprt boolbvt::bv_get_rec(
263264
case bvtypet::IS_C_ENUM:
264265
{
265266
const irep_idt bvrep =
266-
make_bvrep(width, [&value](size_t i) { return value[i] == '1'; });
267+
make_bvrep(width, [&value](size_t i) { return value[value.size()-i-1] == '1'; });
267268
return constant_exprt(bvrep, type);
268269
}
269270
}

0 commit comments

Comments
 (0)