Skip to content
Permalink
Browse files

Z3Builder: fixed sign extension bug

Signed-off-by: Vitaly Chipounov <vitaly@cyberhaven.io>
  • Loading branch information
vitalych committed Nov 23, 2019
1 parent 818e595 commit 3216200aaacae7f124803acbcd79b05855f432d2
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Solver/Z3Builder.cpp
@@ -150,7 +150,7 @@ z3::expr Z3Builder::makeExpr(ref<Expr> e) {

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

0 comments on commit 3216200

Please sign in to comment.
You can’t perform that action at this time.