Skip to content

Commit 912b38e

Browse files
committed
verific: Handle crash when using empty box option
1 parent 3c67d9f commit 912b38e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

frontends/verific/verific.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,8 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
14711471
FOREACH_PARAMETER_OF_NETLIST(nl, mi, param_name, param_value) {
14721472
module->avail_parameters(RTLIL::escape_id(param_name));
14731473
const TypeRange *tr = nl->GetTypeRange(param_name) ;
1474-
module->parameter_default_values[RTLIL::escape_id(param_name)] = verific_const(tr->GetTypeName(), param_value, nl);
1474+
const char* type_name = (tr) ? tr->GetTypeName() : nullptr;
1475+
module->parameter_default_values[RTLIL::escape_id(param_name)] = verific_const(type_name, param_value, nl);
14751476
}
14761477

14771478
SetIter si;
@@ -2171,7 +2172,8 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
21712172
if (is_blackbox(inst->View())) {
21722173
FOREACH_PARAMETER_OF_INST(inst, mi2, param_name, param_value) {
21732174
const TypeRange *tr = inst->View()->GetTypeRange(param_name) ;
2174-
cell->setParam(RTLIL::escape_id(param_name), verific_const(tr->GetTypeName(), param_value, inst->View()));
2175+
const char* type_name = (tr) ? tr->GetTypeName() : nullptr;
2176+
cell->setParam(RTLIL::escape_id(param_name), verific_const(type_name, param_value, inst->View()));
21752177
}
21762178
}
21772179

0 commit comments

Comments
 (0)