Skip to content

Commit

Permalink
Top level parameter no default value core dump fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alaindargelas committed Dec 23, 2023
1 parent 26632ae commit f7c8b59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/DesignCompile/CompileExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2574,7 +2574,9 @@ UHDM::any *CompileHelper::compileExpression(
param_ass->Lhs()->VpiName();
if (param_name == name) {
if ((reduce == Reduce::Yes) ||
(param_ass->Rhs()->UhdmType() == uhdmconstant)) {
(param_ass->Rhs() &&
(param_ass->Rhs()->UhdmType() ==
uhdmconstant))) {
if (substituteAssignedValue(param_ass->Rhs(),
compileDesign)) {
ElaboratorContext elaboratorContext(&s, false,
Expand Down
2 changes: 1 addition & 1 deletion src/DesignCompile/NetlistElaboration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ bool NetlistElaboration::elab_parameters_(ModuleInstance* instance,
inst_assign->VpiOverriden(true);
}
const any* rhs = inst_assign->Rhs();
if (rhs->UhdmType() == uhdmconstant) {
if (rhs && rhs->UhdmType() == uhdmconstant) {
constant* c = (constant*)rhs;
m_helper.adjustSize(tps, instance->getDefinition(), m_compileDesign,
instance, c);
Expand Down

0 comments on commit f7c8b59

Please sign in to comment.