3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

fix bug reported on stackoverflow on crash for unconstrained variables

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-11-05 13:51:27 +01:00
parent 0e83a2b1af
commit 444879db5f
2 changed files with 7 additions and 1 deletions

View file

@ -87,8 +87,13 @@ namespace opt {
smt::theory_opt& opt_solver::get_optimizer() {
smt::context& ctx = m_context.get_context();
smt::theory_id arith_id = m_context.m().get_family_id("arith");
smt::theory* arith_theory = ctx.get_theory(arith_id);
smt::theory* arith_theory = ctx.get_theory(arith_id);
if (!arith_theory) {
ctx.register_plugin(alloc(smt::theory_mi_arith, m, m_params));
arith_theory = ctx.get_theory(arith_id);
SASSERT(arith_theory);
}
if (typeid(smt::theory_mi_arith) == typeid(*arith_theory)) {
return dynamic_cast<smt::theory_mi_arith&>(*arith_theory);
}