3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 12:08:18 +00:00

intblast: fix translation of sign_ext (#7230)

This commit is contained in:
Jakob Rath 2024-05-19 04:01:35 +02:00 committed by GitHub
parent 18a95d89c6
commit e454ae275c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -881,10 +881,10 @@ namespace intblast {
SASSERT(bv.get_bv_size(e) >= bv.get_bv_size(bv_expr)); SASSERT(bv.get_bv_size(e) >= bv.get_bv_size(bv_expr));
unsigned arg_sz = bv.get_bv_size(bv_expr); unsigned arg_sz = bv.get_bv_size(bv_expr);
unsigned sz = bv.get_bv_size(e); unsigned sz = bv.get_bv_size(e);
rational N = rational::power_of_two(sz); // rational N = rational::power_of_two(sz);
rational M = rational::power_of_two(arg_sz); rational M = rational::power_of_two(arg_sz);
expr* signbit = a.mk_ge(r, a.mk_int(M / 2)); expr* signbit = a.mk_ge(r, a.mk_int(M / 2));
r = m.mk_ite(signbit, a.mk_uminus(r), r); r = m.mk_ite(signbit, a.mk_sub(r, a.mk_int(M)), r);
break; break;
} }
case OP_INT2BV: case OP_INT2BV: