Skip to content

Commit 84a7a79

Browse files
committedDec 5, 2023
fix #7037
1 parent f98b42a commit 84a7a79

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

Diff for: ‎src/smt/theory_datatype.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,10 @@ namespace smt {
509509
// Assuming `app` is equal to a constructor term, return the constructor enode
510510
inline enode * theory_datatype::oc_get_cstor(enode * app) {
511511
theory_var v = app->get_root()->get_th_var(get_id());
512-
SASSERT(v != null_theory_var);
512+
if (v == null_theory_var)
513+
return nullptr;
513514
v = m_find.find(v);
514515
var_data * d = m_var_data[v];
515-
SASSERT(d->m_constructor);
516516
return d->m_constructor;
517517
}
518518

@@ -802,8 +802,9 @@ namespace smt {
802802
return false;
803803
func_decl* con = m_util.get_accessor_constructor(f);
804804
for (enode* app : ctx.enodes_of(f)) {
805-
enode* arg = app->get_arg(0)->get_root();
806-
if (is_constructor(arg) && arg->get_decl() != con)
805+
enode* arg = app->get_arg(0);
806+
enode* arg_con = oc_get_cstor(arg);
807+
if (arg_con && is_constructor(arg_con) && arg_con->get_decl() != con)
807808
return true;
808809
}
809810
return false;

0 commit comments

Comments
 (0)