Skip to content

Commit

Permalink
fix several crashes exposed by QF_UFDTNIA benchmark sets
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Jan 30, 2025
1 parent bfe4673 commit f1e0950
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ast/sls/sls_datatype_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ namespace sls {
}
return false;
}
if (dt.get_constructor_is(f))
if (dt.is_is(f))
return false;
return true;
}
Expand Down Expand Up @@ -895,16 +895,19 @@ namespace sls {
if (!is_app(e) || to_app(e)->get_family_id() != m_fid)
return ctx.get_value(e);
auto w = eval1(e);
m_eval.set(e->get_id(), w);
m_eval.setx(e->get_id(), w);
return w;
}

expr_ref datatype_plugin::eval_accessor(func_decl* f, expr* t) {
auto& t2val = m_eval_accessor[f];
if (!t2val.contains(t)) {
if (!m_model)
m_model = alloc(model, m);
auto val = m_model->get_some_value(f->get_range());
m.inc_ref(t);
m.inc_ref(val);
t2val.insert(t, val);
}
return expr_ref(t2val[t], m);
}
Expand Down Expand Up @@ -962,7 +965,7 @@ namespace sls {

void datatype_plugin::set_eval0(expr* e, expr* value) {
if (dt.is_datatype(e->get_sort()))
m_eval[e->get_id()] = value;
m_eval.setx(e->get_id(), value);
else
ctx.set_value(e, value);
}
Expand Down

0 comments on commit f1e0950

Please sign in to comment.