From b744bc9a9796e776cf52e911bb38dc66928d1d65 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Tue, 27 Jan 2026 13:56:11 -0800 Subject: [PATCH] Fix condition to check sort size in datatype declaration --- src/ast/datatype_decl_plugin.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ast/datatype_decl_plugin.cpp b/src/ast/datatype_decl_plugin.cpp index 0d7d52eb2..b1be3f43f 100644 --- a/src/ast/datatype_decl_plugin.cpp +++ b/src/ast/datatype_decl_plugin.cpp @@ -325,7 +325,7 @@ namespace datatype { sort* s = m_manager->mk_sort(name.get_symbol(), sort_info(m_family_id, k, num_parameters, parameters, true)); def* d = nullptr; - if (m_defs.find(s->get_name(), d)) { + if (m_defs.find(s->get_name(), d) && d->sort_size()) { // Validate parameter count matches definition if (d->params().size() != num_parameters - 1) { TRACE(datatype, tout << "Parameter count mismatch for datatype " << name @@ -334,7 +334,6 @@ namespace datatype { m_manager->raise_exception("invalid datatype instantiation: parameter count mismatch"); return nullptr; } - if (d->sort_size()) { obj_map S; for (unsigned i = 0; i + 1 < num_parameters; ++i) { sort* r = to_sort(parameters[i + 1].get_ast()); @@ -344,7 +343,7 @@ namespace datatype { sort_size ts = d->sort_size()->eval(S); TRACE(datatype, tout << name << " has size " << ts << "\n";); s->set_num_elements(ts); - } + } else { TRACE(datatype, tout << "not setting size for " << name << "\n";);