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

fix regression in FPNumRef sign

This commit is contained in:
Nikolaj Bjorner 2021-08-18 10:00:22 -07:00
parent b3db9a1cd5
commit d980ee0533
2 changed files with 5 additions and 1 deletions

View file

@ -9581,7 +9581,7 @@ class FPNumRef(FPRef):
def sign(self): def sign(self):
num = (ctypes.c_int)() num = (ctypes.c_int)()
nsign = Z3_fpa_get_numeral_sign(self.ctx.ref(), self.as_ast(), byref(l)) nsign = Z3_fpa_get_numeral_sign(self.ctx.ref(), self.as_ast(), byref(num))
if nsign is False: if nsign is False:
raise Z3Exception("error retrieving the sign of a numeral.") raise Z3Exception("error retrieving the sign of a numeral.")
return num.value != 0 return num.value != 0

View file

@ -1201,7 +1201,11 @@ bool cmd_context::try_mk_pdecl_app(symbol const & s, unsigned num_args, expr * c
return true; return true;
if (m().is_uninterp(ps) && ps->get_name().is_numerical()) { if (m().is_uninterp(ps) && ps->get_name().is_numerical()) {
int index = ps->get_name().get_num(); int index = ps->get_name().get_num();
if (index < 0)
return false;
binding.reserve(index + 1); binding.reserve(index + 1);
if (binding.get(index) && binding.get(index) != s)
return false;
binding[index] = s; binding[index] = s;
return true; return true;
} }