From f7c8b5931f6744f162562bbb37e73b3fa3ab1eba Mon Sep 17 00:00:00 2001 From: Alain Dargelas Date: Sat, 23 Dec 2023 03:12:43 -0800 Subject: [PATCH] Top level parameter no default value core dump fix --- src/DesignCompile/CompileExpression.cpp | 4 +++- src/DesignCompile/NetlistElaboration.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/DesignCompile/CompileExpression.cpp b/src/DesignCompile/CompileExpression.cpp index b777b4f431..6c3a76c55a 100644 --- a/src/DesignCompile/CompileExpression.cpp +++ b/src/DesignCompile/CompileExpression.cpp @@ -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, diff --git a/src/DesignCompile/NetlistElaboration.cpp b/src/DesignCompile/NetlistElaboration.cpp index 77d2feaf19..14bcec3a06 100644 --- a/src/DesignCompile/NetlistElaboration.cpp +++ b/src/DesignCompile/NetlistElaboration.cpp @@ -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);