Skip to content
This repository was archived by the owner on Feb 3, 2020. It is now read-only.

Commit 3216200

Browse files
Z3Builder: fixed sign extension bug
Signed-off-by: Vitaly Chipounov <vitaly@cyberhaven.io>
1 parent 818e595 commit 3216200

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Solver/Z3Builder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ z3::expr Z3Builder::makeExpr(ref<Expr> e) {
150150

151151
z3::expr src = getOrMakeExpr(ce->getSrc());
152152
if (src.is_bool()) {
153-
return z3::to_expr(context_, Z3_mk_ite(context_, src, context_.bv_val(1, ce->getWidth()),
153+
return z3::to_expr(context_, Z3_mk_ite(context_, src, context_.bv_val(-1, ce->getWidth()),
154154
context_.bv_val(0, ce->getWidth())));
155155
} else {
156156
return z3::to_expr(context_, Z3_mk_sign_ext(context_, ce->getWidth() - src.get_sort().bv_size(), src));

0 commit comments

Comments
 (0)