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:
parent
0e83a2b1af
commit
444879db5f
2 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue