Skip to content

Commit 7834962

Browse files
committed
SMT2: fix extractbit with non-const index
This fixes a constant literal in the encoding of extractbit for the case of a non-const index.
1 parent 5bdff46 commit 7834962

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/solvers/smt2/smt2_conv.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,9 +1812,10 @@ void smt2_convt::convert_expr(const exprt &expr)
18121812
// the arguments of the shift need to have the same width
18131813
out << "(bvlshr ";
18141814
flatten2bv(extractbit_expr.src());
1815+
out << ' ';
18151816
typecast_exprt tmp(extractbit_expr.index(), extractbit_expr.src().type());
18161817
convert_expr(tmp);
1817-
out << ")) bin1)"; // bvlshr, extract, =
1818+
out << ")) #b1)"; // bvlshr, extract, =
18181819
}
18191820
}
18201821
else if(expr.id()==ID_extractbits)

0 commit comments

Comments
 (0)