3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

fix segfault

This commit is contained in:
Jakob Rath 2022-12-19 14:25:58 +01:00
parent 59592754d8
commit 868a3710e0

View file

@ -133,12 +133,13 @@ namespace polysat {
}
// [d,c,b,a] --> d + c*x + b*(x*x) + a*(x*x*x)
expr* mk_poly(univariate const& p) const {
if (p.empty()) {
return mk_numeral(rational::zero());
}
expr_ref mk_poly(univariate const& p) {
expr_ref e(m);
if (p.empty())
e = mk_numeral(rational::zero());
else {
expr* e = p[0] != 0 ? mk_numeral(p[0]) : nullptr;
if (!p[0].is_zero())
e = mk_numeral(p[0]);
expr_ref xpow = x;
for (unsigned i = 1; i < p.size(); ++i) {
if (!p[i].is_zero()) {
@ -150,8 +151,8 @@ namespace polysat {
}
if (!e)
e = mk_numeral(p[0]);
return e;
}
return e;
}
#endif